Jean-Michel Pichavant wrote:
Lie Ryan wrote:
Jean-Michel Pichavant wrote:
snip
Maybe I've been a little bit too dictatorial when I was saying that
renaming namespaces should be avoided.
Sure your way of doing make sense. In fact they're 2 main purposes of
having strong coding rules:
J. Cliff Dyer wrote:
On Wed, 2009-06-17 at 14:13 +0200, Jean-Michel Pichavant wrote:
On Wed, Jun 17, 2009 at 04:14, Steven D'Aprano wrote:
What's np.arange?
import numpy as np
--
Pierre delroth Bourdon delr...@gmail.com
Étudiant à l'EPITA / Student at EPITA
On Mon, 2009-06-22 at 14:57 +0200, Jean-Michel Pichavant wrote:
J. Cliff Dyer wrote:
On Wed, 2009-06-17 at 14:13 +0200, Jean-Michel Pichavant wrote:
On Wed, Jun 17, 2009 at 04:14, Steven D'Aprano wrote:
What's np.arange?
import numpy as np
--
Pierre
J. Cliff Dyer wrote:
On Mon, 2009-06-22 at 14:57 +0200, Jean-Michel Pichavant wrote:
J. Cliff Dyer wrote:
On Wed, 2009-06-17 at 14:13 +0200, Jean-Michel Pichavant wrote:
On Wed, Jun 17, 2009 at 04:14, Steven D'Aprano wrote:
What's np.arange?
Jean-Michel Pichavant wrote:
snip
Maybe I've been a little bit too dictatorial when I was saying that
renaming namespaces should be avoided.
Sure your way of doing make sense. In fact they're 2 main purposes of
having strong coding rules:
1/ ease the coder's life
2/ ease the reader's life
Lie Ryan wrote:
Jean-Michel Pichavant wrote:
snip
Maybe I've been a little bit too dictatorial when I was saying that
renaming namespaces should be avoided.
Sure your way of doing make sense. In fact they're 2 main purposes of
having strong coding rules:
1/ ease the coder's life
2/ ease
On 2009-06-22 13:31, Jean-Michel Pichavant wrote:
Moreover, writing numpy instead of np is not harder for the coder than
switching mentally from np to numpy for the reader. It's just about who
you want to make the life easier, the coder or the reader ?
shrug It depends on the audience. For
On Jun 13, 6:22 pm, Brian Quinlan br...@sweetapp.com wrote:
MRAB wrote:
Brian Quinlan wrote:
kj wrote:
In slrnh37t2p.63e.n...@irishsea.home.craig-wood.com Nick Craig-Wood
n...@craig-wood.com writes:
However I can't think of the last time I wanted to do this - array
elements having
On Wed, Jun 17, 2009 at 04:14, Steven D'Aprano wrote:
What's np.arange?
import numpy as np
--
Pierre delroth Bourdon delr...@gmail.com
Étudiant à l'EPITA / Student at EPITA
Perfect example of why renaming namespaces should be done only when
absolutely required, that is, almost
Jean-Michel Pichavant wrote:
On Wed, Jun 17, 2009 at 04:14, Steven D'Aprano wrote:
What's np.arange?
import numpy as np
Perfect example of why renaming namespaces should be done only when
absolutely required, that is, almost never.
Jean-Michel
Actually, np. is quite commonly used in
On Wed, 2009-06-17 at 14:13 +0200, Jean-Michel Pichavant wrote:
On Wed, Jun 17, 2009 at 04:14, Steven D'Aprano wrote:
What's np.arange?
import numpy as np
--
Pierre delroth Bourdon delr...@gmail.com
Étudiant à l'EPITA / Student at EPITA
Perfect example of why renaming
On 6/17/2009 4:03 PM J. Cliff Dyer apparently wrote:
example code
should always include relevant imports.
Agreed. It was a cut and paste failure.
Apologies.
Alan Isaac
--
http://mail.python.org/mailman/listinfo/python-list
On 6/13/2009 2:11 PM kj apparently wrote:
Switching from Perl here, and having a hard time letting go...
Suppose I have an array foo, and that I'm interested in the 4th, 8th,
second, and last element in that array. In Perl I could write:
my @wanted = @foo[3, 7, 1, -1];
a =
On Wed, 17 Jun 2009 01:50:55 +, Alan G Isaac wrote:
On 6/13/2009 2:11 PM kj apparently wrote:
Switching from Perl here, and having a hard time letting go...
Suppose I have an array foo, and that I'm interested in the 4th, 8th,
second, and last element in that array. In Perl I could
On Wed, Jun 17, 2009 at 04:14, Steven D'Aprano wrote:
What's np.arange?
import numpy as np
--
Pierre delroth Bourdon delr...@gmail.com
Étudiant à l'EPITA / Student at EPITA
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, 2009-06-14 at 23:01 +1000, Steven D'Aprano wrote:
Write a helper function:
def getitems(L, *indexes):
if len(indexes) == 1:
indexes = indexes[0]
return [L[i] for i in indexes]
Whoops! Your example is broken:
cars = ['Ford', 'Toyota', 'Edsel']
getitems(cars, 1)
Jack Diederich wrote:
the square brackets always expect an int or a slice.
true only for lists :)
In [1]: mydict = {}
In [2]: mydict[1,2,3] = 'hi'
In [3]: print mydict[1,2,3]
-- print(mydict[1,2,3])
hi
--
By ZeD
--
http://mail.python.org/mailman/listinfo/python-list
Piet van Oostrum wrote:
kj no.em...@please.post (k) wrote:
k Switching from Perl here, and having a hard time letting go...
k Suppose I have an array foo, and that I'm interested in the 4th, 8th,
k second, and last element in that array. In Perl I could write:
k my @wanted = @foo[3,
kj wrote:
OK, I see: if Python allowed foo[3,7,1,-1], then foo[3] would be
ambiguous: does it mean the fourth element of foo, or the tuple
consisting of this element alone? I suppose that's good enough
reason to veto this idea...
There's nothing ambiguous about it. obj.__getitem__(x)
Switching from Perl here, and having a hard time letting go...
Suppose I have an array foo, and that I'm interested in the 4th, 8th,
second, and last element in that array. In Perl I could write:
my @wanted = @foo[3, 7, 1, -1];
I was a bit surprised when I got this in Python:
wanted =
On Sat, Jun 13, 2009 at 2:11 PM, kjno.em...@please.post wrote:
Switching from Perl here, and having a hard time letting go...
Suppose I have an array foo, and that I'm interested in the 4th, 8th,
second, and last element in that array. In Perl I could write:
my @wanted = @foo[3, 7, 1,
kj no.em...@please.post wrote:
Switching from Perl here, and having a hard time letting go...
Suppose I have an array foo, and that I'm interested in the 4th, 8th,
second, and last element in that array. In Perl I could write:
my @wanted = @foo[3, 7, 1, -1];
I was a bit
kj wrote:
Switching from Perl here, and having a hard time letting go...
Suppose I have an array foo, and that I'm interested in the 4th, 8th,
second, and last element in that array. In Perl I could write:
my @wanted = @foo[3, 7, 1, -1];
Could you explain your use case? It could be that
kj no.em...@please.post writes:
Switching from Perl here, and having a hard time letting go...
Suppose I have an array foo, and that I'm interested in the 4th, 8th,
second, and last element in that array. In Perl I could write:
my @wanted = @foo[3, 7, 1, -1];
I was a bit surprised when
In mailman.1531.1244920680.8015.python-l...@python.org Jack Diederich
jackd...@gmail.com writes:
There is only so much room in the syntax for common cases before you
end up with ... perl (no offense intended, I'm a perl monk[1]). The
Python grammar isn't as context sensitive or irregular as
In slrnh37t2p.63e.n...@irishsea.home.craig-wood.com Nick Craig-Wood
n...@craig-wood.com writes:
However I can't think of the last time I wanted to do this - array
elements having individual purposes are usually a sign that you should
be using a different data structure.
In the case I was
kj wrote:
In slrnh37t2p.63e.n...@irishsea.home.craig-wood.com Nick Craig-Wood
n...@craig-wood.com writes:
However I can't think of the last time I wanted to do this - array
elements having individual purposes are usually a sign that you should
be using a different data structure.
In the
Brian Quinlan wrote:
kj wrote:
In slrnh37t2p.63e.n...@irishsea.home.craig-wood.com Nick Craig-Wood
n...@craig-wood.com writes:
However I can't think of the last time I wanted to do this - array
elements having individual purposes are usually a sign that you should
be using a different data
MRAB wrote:
Brian Quinlan wrote:
kj wrote:
In slrnh37t2p.63e.n...@irishsea.home.craig-wood.com Nick Craig-Wood
n...@craig-wood.com writes:
However I can't think of the last time I wanted to do this - array
elements having individual purposes are usually a sign that you should
be using a
In h113qm$pl...@reader1.panix.com kj no.em...@please.post writes:
OK, I see: if Python allowed foo[3,7,1,-1], then foo[3] would be
ambiguous: does it mean the fourth element of foo, or the tuple
consisting of this element alone? I suppose that's good enough
reason to veto this idea...
Hmmm,
kj no.em...@please.post (k) wrote:
k Switching from Perl here, and having a hard time letting go...
k Suppose I have an array foo, and that I'm interested in the 4th, 8th,
k second, and last element in that array. In Perl I could write:
k my @wanted = @foo[3, 7, 1, -1];
k I was a bit
31 matches
Mail list logo