[英]Returning the recursive call for a void Python function
假设一个函数有一个 void 返回类型(即它不返回一个值,所以它的返回值是None
),是否有区别
def f(x): return f(x_) if not stopping
和
def f(x): f(x_) if not stopping
其中stopping
是一些停止条件, x_
是f
一些输入?
看起来两者之间没有区别。 两者都返回None
并且堆栈是相同的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.