py3k feature proposal: field auto-assignment in constructors

coldpizza vriolk at gmail.com
Tue Jan 29 06:55:35 EST 2008


Hi,

I appreciate everyone's feedback on the topic.

Having reflected on what has been said here, I now realize that
creating more complexity is not the way to go. I would rather favor
something that relies on existing language features, something like
the default keyword argument assignment in functions.

This is probably stupid but as a noob I would have liked something
like:
def __init__( self. = host, self. = port, self. = timeout, message =
"Connected."):
    pass

This is probably even more preposterous than @host, @port, but to me
it would make more sense.

I suppose the subject has exhausted itself and I am not going to
follow it up. If anyone is interested in taking it on, then please do.

Best,
coldpizza


On Jan 29, 6:01 am, "Terry Reedy" <tjre... at udel.edu> wrote:
> "André" <andre.robe... at gmail.com> wrote in message
>
> news:e82b9c41-935d-45c9-8d7b-6bd3fa7eaae5 at i3g2000hsf.googlegroups.com...
> |Here's a version that
> |1. does not require new syntax
> |2. does not *necessarily* override the "_" prefix convention
>
> 'self_' is way too bulky and intrusive.  Putting '_' at the end of the word
> is nearly as easy to detect and conflicts with no convention I know of.
>
> tjr




More information about the Python-list mailing list