[Python-Dev] syntactic sugar idea for {static,class}methods

Guido van Rossum [email protected]
Tue, 12 Feb 2002 14:11:15 -0500


>     MH> class C(object):
>     MH>     def static(arg) [staticmethod]:
>     MH>     return 1 + arg
> 
>     BAW> Why the square brackets though?
> 
> I believe Guido addressed this in his DevDay presentation.  The list
> construct is to allow future extensions without requiring parser changes.

It was only one of the many grammar options I proposed, semi-jokingly.

--Guido van Rossum (home page: http://www.python.org/~guido/)



Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant