On 4/26/22 09:31, MRAB wrote:
On 2022-04-26 06:32, Larry Hastings wrote:
Note that this spelling is also viable:
class C
I don't like that because it looks like you've just forgotten the colon.
Perhaps:
class C: ...
That's not a good idea. Every other place in Python where there's a
statement that ends in a colon, it's followed by a nested block of
code. But the point of this statement is to forward-declare C, and this
statement /does not have/ a class body. Putting a colon there is
misleading.
Also, your suggestion is already legal Python syntax; it creates a class
with no attributes. So changing this existing statement to mean
something else would potentially (and I think likely) break existing code.
Consider C++'s forward-declared class statement:
class C;
You could say about that, "I don't like that because it looks like
you've just forgotten the curly braces." But we didn't forget anything,
it's just new syntax for a different statement.
//arry/
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at
https://mail.python.org/archives/list/python-dev@python.org/message/S54FAGLEKF22T3WTLTIZ37FW3BVMJQ3V/
Code of Conduct: http://python.org/psf/codeofconduct/