Aahz a écrit :
In article gi4834$la...@zinnia.noc.ucla.edu,
James Stroud jstr...@mbi.ucla.edu 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
In article 494611c2$0$21934$426a3...@news.free.fr,
Bruno Desthuilliers bruno.42.desthuilli...@websiteburo.invalid wrote:
Aahz a écrit :
In article gi4834$la...@zinnia.noc.ucla.edu,
James Stroud jstr...@mbi.ucla.edu wrote:
In case its not obvious:
Ah, so that's where Bruno's extra
James Stroud wrote:
Aahz wrote:
In article gi4834$la...@zinnia.noc.ucla.edu,
James Stroud jstr...@mbi.ucla.edu 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
James Stroud wrote:
Aahz wrote:
In article gi4834$la...@zinnia.noc.ucla.edu,
James Stroud jstr...@mbi.ucla.edu 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
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
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 =
On 14 Dec, 16:22, Bruno Desthuilliers
bdesth.quelquech...@free.quelquepart.fr 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
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
nitThat isn't a slice, it's indexing/nit
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC
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
nitThat isn't a slice, it's indexing/nit
Yeps, sorry - and thanks for the correction.
--
On Sun, 14 Dec 2008 09:51:03 -0800, Paul Moore wrote:
On 14 Dec, 16:22, Bruno Desthuilliers
bdesth.quelquech...@free.quelquepart.fr 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
On Dec 14, 5:51 pm, Paul Moore p.f.mo...@gmail.com wrote:
On 14 Dec, 16:22, Bruno Desthuilliers
bdesth.quelquech...@free.quelquepart.fr 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
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 =
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))
On Dec 14, 11:19 am, Paul Moore p.f.mo...@gmail.com 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
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
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
In article gi4834$la...@zinnia.noc.ucla.edu,
James Stroud jstr...@mbi.ucla.edu 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
Aahz wrote:
In article gi4834$la...@zinnia.noc.ucla.edu,
James Stroud jstr...@mbi.ucla.edu 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
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
James Stroud jstr...@mbi.ucla.edu 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
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
21 matches
Mail list logo