[Python-Dev] syntactic sugar idea for {static,class}methods (original) (raw)
Gareth McCaughan gmccaughan@synaptics-uk.com
Wed, 13 Feb 2002 17:11:57 +0000 (GMT)
- Previous message: [Python-Dev] Expat vs Windows
- Next message: [Python-Dev] syntactic sugar idea for {static,class}methods
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Michael Hudson wrote (replying to Barry Warsaw):
> Very interesting! Why the square brackets though? Is that just for > visual offset or is there a grammar constraint that requires them?
Um, no big reason; they were what Gareth suggested, so I implemented that. He may have got the idea from the slides from one of Guido's presentations -- it was reading them that reminded me I'd done this and wanted to mention it here.
Four reasons for the brackets.
- Easier for the parser, I think.
- Visually distinctive.
- For me, it "reads" better than it would without the brackets.
- Generalizes to a sequence of transformations.
#4 is much the most important of these in my mind.
One drawback of allowing an arbitrary list of transformations is that it might not be completely clear what order they're done in. I conjecture that most people will have the same intuition as I do about this, namely that the first-listed transformation is applied first. (It would be less obvious if the list came before the name of the definiendum instead of after.)
Oh, and for the record: My suggestion was made long before I ever saw Guido's slides. :-)
-- Gareth McCaughan
- Previous message: [Python-Dev] Expat vs Windows
- Next message: [Python-Dev] syntactic sugar idea for {static,class}methods
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]