A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-August/048180.html below:

[Python-Dev] Re: __metaclass__ and __author__ are already decorators

[Python-Dev] Re: __metaclass__ and __author__ are already decorators [Python-Dev] Re: __metaclass__ and __author__ are already decoratorsPaul Morrow pm_mon at yahoo.com
Sat Aug 21 23:15:09 CEST 2004
Christophe Cavalaria wrote:

> Paul Morrow wrote:
> 
> 
>>     class Foo:
>>         """ This describes the Foo class as normal. """
>>         __metaclass__ = M
>>         __author__ = 'Paul Morrow'
>>         __version__ = '0.1'
>>         __automethods__ = True
>>
>>
>>         def baz(self, a, b):
>>             """ This describes the baz method. """
>>             __synchronized__ = True
>>             __returns__ = None
>>             __author__ = 'Neville Shunt'
>>             # body of baz goes here...
> 
> 
> It's a function call that masquerades as an attribute assignment. How worse
> can it be ? 

How about we create new syntax that uses an @ and special words, where 
the words correspond with functions to be called.  That's what is 
seriously being considered.  And that would be worse (IMO).



> can it be ? There's also the fact that it can't handle named parameters
> like a regular function call. You can't write that :
> 
> def foo():
>     __decoration__ = (1,1,param=True)
> 

As far as I know, we can't do that with the current decorator proposals 
either.


[But that is something that I've often wanted to do (create a tuple that 
contains named arguments).]

More information about the Python-Dev mailing list

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