[Python-Dev] Re: PEP 318: Decorators last before colon (original) (raw)
Bob Ippolito bob at redivi.com
Wed Mar 31 19:08:44 EST 2004
- Previous message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Next message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Mar 31, 2004, at 6:43 PM, Neil Schemenauer wrote:
On Wed, Mar 31, 2004 at 03:04:18PM -0500, Bob Ippolito wrote:
On Mar 31, 2004, at 1:59 PM, Michel Pelletier wrote:
Please don't add any decorator syntax to Python, at least not yet. All of the proposals I have seen so far are, to be blunt, and in my opinion of course, ugly and are getting uglier as the discussion ensues. I agree with Michel. The decorator syntax being discussed looks ugly. I think it would be okay if the set of valid decorations were limited to 'classmethod', 'staticmethod' and maybe a few others. Allowing more general expressions seems to asking for abuse. Decorators solve a huge problem with the current syntax:
def someObjectiveCSelectoryesTheyCanBeThisLongsometimesLonger(takes, some, args, here): pass someObjectiveCSelectoryesTheyCanBeThisLongsometimesLonger = objc.selector(someObjectiveCSelectoryesTheyCanBeThisLongsometimesLon ge r, signature='some type signature') I would be happer if there was an easier way for you to do what you want without introducing new syntax to that language. For example, what if '' was bound to the last defined function? You could then do something like this: def someObjectiveCSelectoritsReallyLong(takes, some, args, here): pass objc.selector(, signature='some type signature') That looks pretty nice and is even shorter to type than the proposed syntax.
No, that is not correct.. it must rebind the name... it doesn't mutate
the function, it returns a selector descriptor. It's also easy to lose
once you have functions that do things other than pass. It really
ought to be in close proximity to the def statement, if it's not just
an extension to the def syntax.
-bob
- Previous message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Next message: [Python-Dev] Re: PEP 318: Decorators last before colon
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]