25 Apr
2012
25 Apr
'12
4:06 p.m.
On 04/24/2012 03:15 PM, Mark Shannon wrote:
This has to be the only few feature request that can implemented by removing code :)
I implemented this by deleting 2 lines of code from the compiler.
Does it also allow returns in class bodies when you do that?
class A: ... return ... File "<stdin>", line 2 SyntaxError: 'return' outside function
Weather or not it does. I think modules are closer to class bodies and return should be a syntax error in that case as well. They aren't functions and we shouldn't think of them that way. IMHO It would make Python harder to learn when the lines between them get blurred. Cheers, Ron