anonymous assignment
Ben Finney
bignose+hates-spam at benfinney.id.au
Sun May 11 23:46:07 EDT 2008
Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:
> Yves Dorfsman <yves at zioup.com> writes:
> > I know you can't assign anything to None, but I'm sure you get what I
> > mean, a special keyword that means I don't care about this value.
Snap. This topic was raised today in another thread.
> You can just use a variable name than you ignore. It's traditional
> to use _ but it's not a special keyword, it's just a another
> variable name:
>
> y, _, d, _, _, _, _, _, _ = time.localtime()
It's a terrible name for that purpose, since it doesn't indicate the
intention explicitly, and it's already overloaded in meaning by a
pre-existing convention (ref. the 'gettext' module in Python and many
other languages).
Far better to use the name 'unused' as suggested by Carl Banks earlier
today.
(good sigmonster, have a cookie)
--
\ "Choose mnemonic identifiers. If you can't remember what |
`\ mnemonic means, you've got a problem." —Larry Wall |
_o__) |
Ben Finney
More information about the Python-list
mailing list