PEP 318: Can't we all just get along?
Dan Sommers
me at privacy.net
Wed Aug 18 07:30:05 EDT 2004
On Tue, 17 Aug 2004 21:13:47 -0400,
Paul Morrow <pm_mon at yahoo.com> wrote:
> First though, I still believe that we should exploit existing
> conventions (recommended coding practices) as a way of getting 'free'
> declarations for class, static, and instance methods (e.g. methods
> whose first param is 'self' are instance methods, etc.). That feels
> very pythonic to me, just as we use naming conventions to distinguish
> public, private, and semi-private methods.
I don't understand how assigning semantic significance to a "recommended
coding practice" is Pythonic.
In the face of ambiguity, refuse to guess.
Explicit is better than implicit.
I think that the idea that started this thread is just right:
def decorator function( arguments ): pass
is exactly equivalent to
def function( arguments ): pass
decorator( function )
Note that:
- the decorator is right next to the function name
- the decorator is outside the code of the function
- there are no new keywords or punctuation
- it's dynamic, flexible, and extensible
It's also abusable, but that's the nature of a language as dynamic as
Python.
Regards,
Dan
--
Dan Sommers
<http://www.tombstonezero.net/dan/>
Never play leapfrog with a unicorn.
More information about the Python-list
mailing list