osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Recursive method in class


Le 01/10/2019 ? 13:18, Rhodri James a ?crit?:
> On 01/10/2019 08:37, ast wrote:


>> The problem is that "factorial" in line
>> "return n * factorial(self, n - 1)" should not have been found
>> because there is no factorial function defined in the current
>> scope.
> 
> Not so.? "factorial" is in the global scope of your module, which is 
> always available.
> 

yes, you rae right. It is clear now