(original) (raw)
Other strange thing is that the \`raise\`
statement doesn't require to instantiate an Exception object,
allowing to pass an Exception class to it.
raise NotImplementedError
raise NotImplementedError()
Is there any difference between this two lines of code?
And there is nothing about that fact in python docs. (or I just not found?..)
31.01.2013 20:35, Jason Keene пишет:
raise NotImplementedError
raise NotImplementedError()
Is there any difference between this two lines of code?
And there is nothing about that fact in python docs. (or I just not found?..)
-- Andrew
31.01.2013 20:35, Jason Keene пишет:
Why do function definitions require parens?This seems to me to break a symmetry with class definitions. I assume this is just a hold off from C, perhaps there is a non-historical reason tho.
>>> class MyClass:
... pass
...
\>>> def my\_func:
File "", line 1
def my\_func:
^
SyntaxError: invalid syntax
I believe in the past we've forced parens in list comprehensions to create a symmetry between comprehensions/generator expressions. Why not for this?
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ Python-ideas mailing list Python-ideas@python.org http://mail.python.org/mailman/listinfo/python-ideas