pre-PEP: Suite-Based Keywords - syntax proposal

Kay Schluehr kay.schluehr at gmx.net
Sun Apr 17 02:43:03 EDT 2005


Robert Brewer wrote:
> Bengt Richter wrote:
> > The '::' unary suite operator should return an ordered dict
> > subtype representing the bindings
>
> Why ordered?

Because You can't otherwise guarantee to feed optional argument
parameters in a correct way.

Example:

x = property(*seq) where:
            seq = (item[1] for item in ::
                def get_x():
                    return self.__x
                def set_x(value):
                    self.__x = value
                del_x = None
                doc   = "I'm the 'x' property." )

This statement would not work if the result of '::' ( considered as an
"ordered dict" ) would return simply a dict because the order of the
input parameters matters.

Ciao,
Kay




More information about the Python-list mailing list