At 11:32 AM 3/26/04 -0600, Skip Montanaro wrote: >Using the proposed decorator syntax with the decorator after the arglist >with a little judicious indentation I can make it look sort of like what >you're after: > > def foobar(self, arg) [attributes( > author = "Guido van Rossum" > deprecated = True > )]: > pass Thinking about it a bit more, I can now explain why I see a problem with creating a second syntax for function attributes. It has seemed to me the unwritten rule of Python is: * Never create syntax if a builtin will do * Never create a builtin if a stdlib module will do and so on. A decorator syntax can trivially support function attributes, but not the other way around. Arguing that they should have a different spelling seems therefore to be a purity vs. practicality argument. At the same time, I realize Python also generally prefers to have different syntax for different use cases. But, how different are these use cases, really? They're all changing the function in some way. It's apparent Guido doesn't agree; I just wish I knew what was bothering him about the PEP, so I could either provide a convincing counterargument, or understand better why I'm wrong. <0.5 wink> At the moment, I'm worried that something in my actual use cases will scare him into rejecting the PEP altogether. <0.01 wink>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4