On Mon, 04 Jul 2005 09:11:19 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>On Sun, 03 Jul 2005 19:19:05 +, Bengt Richter wrote:
>
>> On Sun, 03 Jul 2005 11:47:07 +1000, Steven D'Aprano <[EMAIL PROTECTED]>
>> wrote:
>>
>>>On Fri, 01 Jul 2005 12:59:20 -0400, François Pinard wrote:
>>>
>>>
On Sun, 03 Jul 2005 19:19:05 +, Bengt Richter wrote:
> On Sun, 03 Jul 2005 11:47:07 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>
>>On Fri, 01 Jul 2005 12:59:20 -0400, François Pinard wrote:
>>
>>> [Peter Hansen]
Mike Meyer wrote:
> Yes. I once grabbed an old program that did
On Sun, 03 Jul 2005 11:47:07 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote:
>On Fri, 01 Jul 2005 12:59:20 -0400, François Pinard wrote:
>
>> [Peter Hansen]
>>> Mike Meyer wrote:
>>> > Yes. I once grabbed an old program that did assignments to None. But
>>> > that's always been a bad idea.
>>
>
François Pinard wrote:
> [Rocco Moretti]
>
>
>>foo, bar, _ = gen_tuple(stuff)
>
>
>>as '_' is already special cased (last result in interactive mode), and
>>is already used for "don't care" sematics in Prolog.
>
>
> `_' is also the `gettext' function in internationalised programs. It so
> se
On Fri, 01 Jul 2005 12:59:20 -0400, François Pinard wrote:
> [Peter Hansen]
>> Mike Meyer wrote:
>> > Yes. I once grabbed an old program that did assignments to None. But
>> > that's always been a bad idea.
>
>> What was the use case!?
>
> People used to assign None to itself as a keyword argume
Mike Meyer wrote:
> Peter Hansen <[EMAIL PROTECTED]> writes:
>> Mike Meyer wrote:
>>> Yes. I once grabbed an old program that did assignments to None. But
>>> that's always been a bad idea.
>> What was the use case!?
>
> Unpacking a tuple. Something like this:
>
> (foo, bar, None) = gen
[Rocco Moretti]
> foo, bar, _ = gen_tuple(stuff)
> as '_' is already special cased (last result in interactive mode), and
> is already used for "don't care" sematics in Prolog.
`_' is also the `gettext' function in internationalised programs. It so
seems that `_' is in great demand! :-)
--
Fr
Mike Meyer wrote:
> Peter Hansen <[EMAIL PROTECTED]> writes:
>
>
>>Mike Meyer wrote:
>>
>>>Yes. I once grabbed an old program that did assignments to None. But
>>>that's always been a bad idea.
>>
>>What was the use case!?
>
>
> Unpacking a tuple. Something like this:
>
> (foo, bar,
[Roy Smith]
> 4) foo, bar = gen_tuple(stuff)[0:1]. In some ways, this is the
>cleanest because it doesn't pollute the namespace with an un-needed
>variable, but I think it's the least readable.
Less legible often means more error prone. For example, here,
foo, bar = gen_tuple(stuf
>Peter Hansen <[EMAIL PROTECTED]> writes:
>
>> Mike Meyer wrote:
>>> Yes. I once grabbed an old program that did assignments to None. But
>>> that's always been a bad idea.
>> What was the use case!?
>
>Unpacking a tuple. Something like this:
>
> (foo, bar, None) = gen_tuple(stuff)
I can
Peter Hansen <[EMAIL PROTECTED]> writes:
> Mike Meyer wrote:
>> Yes. I once grabbed an old program that did assignments to None. But
>> that's always been a bad idea.
> What was the use case!?
Unpacking a tuple. Something like this:
(foo, bar, None) = gen_tuple(stuff)
I've never seen
[Peter Hansen]
> Mike Meyer wrote:
> > Yes. I once grabbed an old program that did assignments to None. But
> > that's always been a bad idea.
> What was the use case!?
People used to assign None to itself as a keyword argument in function
headers. The goal was to make a local copy of the refere
Mike Meyer wrote:
> Yes. I once grabbed an old program that did assignments to None. But
> that's always been a bad idea.
What was the use case!?
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
13 matches
Mail list logo