James Stroud wrote:
> Aahz wrote:
>> In article ,
>> James Stroud wrote:
>>> In case its not obvious:
>>
>> Ah, so that's where Bruno's extra apostrophe came from! ;-)
>>
>>
>> (Sorry about the spelling flame, but seeing three posts in quick
>> succession with incorrect spelling of its/it's push
In article <494611c2$0$21934$426a3...@news.free.fr>,
Bruno Desthuilliers wrote:
>Aahz a écrit :
>> In article ,
>> James Stroud wrote:
>>>
>>> In case its not obvious:
>>
>> Ah, so that's where Bruno's extra apostrophe came from! ;-)
>
>Err... Which one exactly ?
Don't remember, it was a pos
James Stroud wrote:
Aahz wrote:
In article ,
James Stroud wrote:
In case its not obvious:
Ah, so that's where Bruno's extra apostrophe came from! ;-)
(Sorry about the spelling flame, but seeing three posts in quick
succession with incorrect spelling of its/it's pushed me into making a
pu
Aahz a écrit :
In article ,
James Stroud wrote:
In case its not obvious:
Ah, so that's where Bruno's extra apostrophe came from! ;-)
Err... Which one exactly ?
(Sorry about the spelling flame, but seeing three posts in quick
succession with incorrect spelling of its/it's pushed me into
I V wrote:
On Sun, 14 Dec 2008 21:08:33 -0800, James Stroud wrote:
Yes. I think it was the British who decided that the apostrophe rule for
"it" would be reversed from normal usage relative to just about every
other noun. I'm not sure the purpose--maybe it was to give compulsive
proofreaders a r
James Stroud writes:
> Yes. I think it was the British who decided that the apostrophe rule
> for "it" would be reversed from normal usage relative to just about
> every other noun.
Remember that “it” is a pronoun. I see no reversal:
he she we theyme you it
On Sun, 14 Dec 2008 21:08:33 -0800, James Stroud wrote:
> Yes. I think it was the British who decided that the apostrophe rule for
> "it" would be reversed from normal usage relative to just about every
> other noun. I'm not sure the purpose--maybe it was to give compulsive
> proofreaders a raison
Aahz wrote:
In article ,
James Stroud wrote:
In case its not obvious:
Ah, so that's where Bruno's extra apostrophe came from! ;-)
(Sorry about the spelling flame, but seeing three posts in quick
succession with incorrect spelling of its/it's pushed me into making a
public comment.)
Yes.
In article ,
James Stroud wrote:
>
>In case its not obvious:
Ah, so that's where Bruno's extra apostrophe came from! ;-)
(Sorry about the spelling flame, but seeing three posts in quick
succession with incorrect spelling of its/it's pushed me into making a
public comment.)
--
Aahz (a...@pyth
James Stroud wrote:
inspect.stack()[1][0].f_locals[name] = val
I just double checked this. Because of the way locals are implemented in
cPython, this won't have the desired affect.
James
--
http://mail.python.org/mailman/listinfo/python-list
drobi...@gmail.com wrote:
I'm baffled by this discussion.
What's wrong with
a, dontcare, dontcare2 = f()
a = a + 1
Simple, clear, and correct.
1. This can't apply to a generalized f() that may return an arbitrary
number of arguments >= len(num_assignments_you_care_about).
2. The examp
On Dec 14, 11:19 am, Paul Moore wrote:
> I'm translating some code from another language (Lua) which has
> multiple function return values. So, In Lua, it's possible to define a
> function
>
> function f()
> return 1,2,3
> end
>
> which returns 3 values. These can then be used/ass
James Stroud wrote:
py> class mytuple(tuple):
def magic(self, astr):
names = astr.split()
for name, val in zip(names, self):
globals()[name] = val
...
py> t = mytuple((1,2,3))
py> t.magic('a b')
py> a
1
py> b
2
James
In case its not obvious:
def f():
return mytuple((1,2,3))
Paul Moore wrote:
I'm translating some code from another language (Lua) which has
multiple function return values. So, In Lua, it's possible to define a
function
function f()
return 1,2,3
end
which returns 3 values. These can then be used/assigned by the caller:
a,b,c = f()
On Dec 14, 5:51 pm, Paul Moore wrote:
> On 14 Dec, 16:22, Bruno Desthuilliers
>
> wrote:
> > if you only want the first returned value, you can just apply a slice:
>
> > def f():
> > return 1,2,3
>
> > a = f()[0] + 1
>
> Hmm, true. I'm not sure it's any less ugly, though :-)
>
> > FWIW, Pyth
On Sun, 14 Dec 2008 09:51:03 -0800, Paul Moore wrote:
> On 14 Dec, 16:22, Bruno Desthuilliers
> wrote:
>> if you only want the first returned value, you can just apply a slice:
>>
>> def f():
>> return 1,2,3
>>
>> a = f()[0] + 1
>
> Hmm, true. I'm not sure it's any less ugly, though :-)
>
Steve Holden a écrit :
Bruno Desthuilliers wrote:
[...]
if you only want the first returned value, you can just apply a slice:
def f():
return 1,2,3
a = f()[0] + 1
That isn't a slice, it's indexing
Yeps, sorry - and thanks for the correction.
--
http://mail.python.org/mailman/listinfo/p
Bruno Desthuilliers wrote:
[...]
> if you only want the first returned value, you can just apply a slice:
>
> def f():
>return 1,2,3
>
> a = f()[0] + 1
>
That isn't a slice, it's indexing
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC ht
On 14 Dec, 16:22, Bruno Desthuilliers
wrote:
> if you only want the first returned value, you can just apply a slice:
>
> def f():
> return 1,2,3
>
> a = f()[0] + 1
Hmm, true. I'm not sure it's any less ugly, though :-)
> FWIW, Python 2.6 has NamedTuple objects...
I know, but I want to targ
Paul Moore a écrit :
I'm translating some code from another language (Lua) which has
multiple function return values. So, In Lua, it's possible to define a
function
function f()
return 1,2,3
end
which returns 3 values. These can then be used/assigned by the caller:
a,b,c =
I'm translating some code from another language (Lua) which has
multiple function return values. So, In Lua, it's possible to define a
function
function f()
return 1,2,3
end
which returns 3 values. These can then be used/assigned by the caller:
a,b,c = f()
So far, much like
21 matches
Mail list logo