Re:syntax for ellipsis like as "net.blobs['data'].data[...] = transformed_image"

2019-10-26 Thread xuanwu348
Thanks too, I have find the answer from "https://stackoverflow.com/questions/772124/what-does-the-python-ellipsis-object-do"; This came up in another question recently. I'll elaborate on my answer from there: Ellipsis is an object that can appear in slice notation. For examp

syntax for ellipsis like as "net.blobs['data'].data[...] = transformed_image"

2019-10-26 Thread xuanwu348
ata'].reshape(50, 3, 227,227) net.blobs['data'].data[...] = transformed_image 1. For ellipsis, is there syntax in python like this " net.blobs['data'].data[...]"? I have checked it which the type is "" 2. Could you provide some sa

Re: ... (ellipsis)

2018-06-01 Thread Mike McClain
On Thu, May 31, 2018 at 11:00:13PM -0400, Terry Reedy wrote: > On 5/31/2018 10:26 PM, Mike McClain wrote: > > I'm having understanding the use if the ellipsis. > >I keep reading that it is used in slices > > By numpy for numpy multidimensional arrays, which have thei

Re: ... (ellipsis)

2018-05-31 Thread Terry Reedy
On 5/31/2018 10:26 PM, Mike McClain wrote: I'm having understanding the use if the ellipsis. I keep reading that it is used in slices By numpy for numpy multidimensional arrays, which have their own __getitem__, which recognizes and gives meaning to ... -- Terry Jan Reedy --

... (ellipsis)

2018-05-31 Thread Mike McClain
I'm having understanding the use if the ellipsis. I keep reading that it is used in slices but every time I use it I get 'Syntax error' in 2.7 if 'Type error' in 3.2. In python2.7: l=range(15) l[...:11] Syntax error l[3:...] Syntax error l[3:...:11] Syntax error In p

Re: proposal: Ellipsis in argument list

2013-01-14 Thread Chris Kaynor
On Sat, Jan 12, 2013 at 5:30 AM, Szabolcs Blága wrote: > Dear All, > > I have an idea that the Ellipsis object could be used in function calls. > The "..." syntax should automagically turn into an Ellipsis positional > argument. > > def f(*args): > ext_args =

Re: proposal: Ellipsis in argument list

2013-01-12 Thread Stefan Behnel
Szabolcs Blága, 12.01.2013 14:30: > I have an idea that the Ellipsis object could be used in function calls. > The "..." syntax should automagically turn into an Ellipsis positional > argument. > > def f(*args): > ext_args = [] > for i, a in enumerat

proposal: Ellipsis in argument list

2013-01-12 Thread Szabolcs Blága
Dear All, I have an idea that the Ellipsis object could be used in function calls. The "..." syntax should automagically turn into an Ellipsis positional argument. def f(*args): ext_args = [] for i, a in enumerate(args): if a is Ellipsis: ext_args.extend([x for x in rang

Python Pickle Problems (Ellipsis + Other Objects)

2011-06-14 Thread Sunjay Varma
See more details in my forum post: http://www.python-forum.org/pythonforum/viewtopic.php?f=18&t=26724 I'm trying to pickle a bunch of functions (mostly built-in) and pickle keeps giving me errors. I have no Ellipsis in my data at all, and for some reason, pickle seems to think I do.

Re: Ignore leading '>>>' and ellipsis?

2010-01-15 Thread r0g
tudying some examples in a tutorial where there are a lot of >> leading >>> characters and ellipsis in the text. This makes it hard to >> cut and paste into the IPython interpreter since it doesn't like these >> strings. >> >> Is there another interpret

Re: Ignore leading '>>>' and ellipsis?

2010-01-14 Thread Rhodri James
On Thu, 14 Jan 2010 17:13:54 -, Reckoner wrote: I am studying some examples in a tutorial where there are a lot of leading >>> characters and ellipsis in the text. This makes it hard to cut and paste into the IPython interpreter since it doesn't like these strings. Is

Re: Ignore leading '>>>' and ellipsis?

2010-01-14 Thread Javier Collado
Hello, I think that's exactly what the cpaste magic function does. Type 'cpaste?' in your IPython session for more information. Best regards, Javier 2010/1/14 Reckoner : > > Hi, > > I am studying some examples in a tutorial where there are a lot of > leading

Ignore leading '>>>' and ellipsis?

2010-01-14 Thread Reckoner
Hi, I am studying some examples in a tutorial where there are a lot of leading >>> characters and ellipsis in the text. This makes it hard to cut and paste into the IPython interpreter since it doesn't like these strings. Is there another interpreter I could use that will approp

Re: Extended slicing and Ellipsis - where are they used?

2007-09-15 Thread Rodney Maxwell
On Sep 13, 5:50 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Rodney Maxwell wrote: > > The following are apparently legal Python syntactically: > >L[1:3, 8:10] > >L[1, ..., 5:-2] > > > But they don't seem to work on lists: > l = [0,1,2,3] > l[0:2,3] > > Traceback (most recent cal

Re: Extended slicing and Ellipsis - where are they used?

2007-09-15 Thread Rodney Maxwell
On Sep 13, 5:50 pm, James Stroud <[EMAIL PROTECTED]> wrote: > Rodney Maxwell wrote: > > The following are apparently legal Python syntactically: > >L[1:3, 8:10] > >L[1, ..., 5:-2] > > > But they don't seem to work on lists: > l = [0,1,2,3] > l[0:2,3] > > Traceback (most recent cal

Re: Extended slicing and Ellipsis - where are they used?

2007-09-14 Thread Paddy
On Sep 15, 12:29 am, James Stroud <[EMAIL PROTECTED]> wrote: > Paddy wrote: > > And the ellipses ... ? > > ;) > > py> class Bob(dict): > ... def __getitem__(self, k, *args, **kwargs): > ... if k is Ellipsis: > ... return sorted(self.keys())

Re: Extended slicing and Ellipsis - where are they used?

2007-09-14 Thread James Stroud
Paddy wrote: > And the ellipses ... ? ;) py> class Bob(dict): ... def __getitem__(self, k, *args, **kwargs): ... if k is Ellipsis: ... return sorted(self.keys()) ... else: ... return dict.__getitem__(self, k, *args, **kwargs) ... def __setitem__(self, k, *args, **

Re: Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread Paddy
On Sep 14, 1:50 am, James Stroud <[EMAIL PROTECTED]> wrote: > Rodney Maxwell wrote: > > The following are apparently legal Python syntactically: > >L[1:3, 8:10] > >L[1, ..., 5:-2] > > > But they don't seem to work on lists: > l = [0,1,2,3] > l[0:2,3] > > Traceback (most recent cal

Re: Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread James Stroud
Rodney Maxwell wrote: > The following are apparently legal Python syntactically: >L[1:3, 8:10] >L[1, ..., 5:-2] > > But they don't seem to work on lists: l = [0,1,2,3] l[0:2,3] > Traceback (most recent call last): > File "", line 1, in > TypeError: list indices must be integer

Re: Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread Robert Kern
Rodney Maxwell wrote: > The following are apparently legal Python syntactically: >L[1:3, 8:10] >L[1, ..., 5:-2] > > But they don't seem to work on lists: l = [0,1,2,3] l[0:2,3] > Traceback (most recent call last): > File "", line 1, in > TypeError: list indices must be integer

Extended slicing and Ellipsis - where are they used?

2007-09-13 Thread Rodney Maxwell
The following are apparently legal Python syntactically: L[1:3, 8:10] L[1, ..., 5:-2] But they don't seem to work on lists: >>> l = [0,1,2,3] >>> l[0:2,3] Traceback (most recent call last): File "", line 1, in TypeError: list indices must be integers >>> l[...] Traceback (most recent call

Re: doctest's ELLIPSIS

2005-05-02 Thread Sébastien Boisgérault
(Forwarded from Python bug tracker) [ 1192554 ] doctest's ELLIPSIS and multiline statements Tim Peters: [...] doctest has few syntax requirements, but the inability to start an expected output block with "..." has always been one of them, and is independent of the ELLIPSIS gimmick

Re: doctest's ELLIPSIS

2005-04-29 Thread Sébastien Boisgérault
Done. -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest's ELLIPSIS

2005-04-29 Thread Michele Simionato
I would file a bug report/documentation bug/feature request or whatever to sourceforge. Michele Simionato -- http://mail.python.org/mailman/listinfo/python-list

Re: doctest's ELLIPSIS

2005-04-29 Thread Sébastien Boisgérault
Doh ! Obviously ... too bad. I guess that I could set doctest.ELLIPSIS_MARKER to "[...]" to distinguish the two usages of "...". (The "..." used for multiline statements is hard-coded into a regular expression pattern). But it feels too hackish, ELLIPSIS_MATKER being not described in the docs ..

Re: doctest's ELLIPSIS

2005-04-29 Thread Michele Simionato
I think doctest believes the line starting with ... is a continuation line in a multiline statement. -- http://mail.python.org/mailman/listinfo/python-list

doctest's ELLIPSIS

2005-04-29 Thread Sébastien Boisgérault
Hi, Can anybody come up with a sensible argument that would explain why the following test should fail ? (Expected: nothing, Got: 42). cheers, S.B. #!/usr/bin/env python import doctest def test(): """ >>> prin

Re: slicing, mapping types, ellipsis etc.

2004-11-30 Thread Kent Johnson
Nick Coghlan wrote: Kent Johnson wrote: Maybe instead of referring to mappings it should say "The primary must implement __getitem__(), which is called with a value that is constructed from the slice list, as follows." In the section you mention, 'mapping' is equivalent to 'has __getitem__ defi

Re: slicing, mapping types, ellipsis etc.

2004-11-30 Thread Nick Coghlan
Kent Johnson wrote: Maybe instead of referring to mappings it should say "The primary must implement __getitem__(), which is called with a value that is constructed from the slice list, as follows." In the section you mention, 'mapping' is equivalent to 'has __getitem__ defined', and I'd be surp

Re: slicing, mapping types, ellipsis etc.

2004-11-30 Thread Kent Johnson
Nick Coghlan wrote: Jerry Sievers wrote: Fellow Pythonists; I am totally puzzled on the use of slicing on mapping types and It's generally not supported (since slices are designed to work with the numerical indices of a sequence, not the arbitrary keys of a mapping). Section 5.3.3 of the Language

Re: slicing, mapping types, ellipsis etc.

2004-11-30 Thread Nick Coghlan
; d.items() can all be sliced like any other sequence, though. especially unsure on use of the Ellipsis... and slicing syntax that has two or more groups seperated by comma. Others have explained these - one point that may not have been entirely clear is that none of the classes in the standard lib

Re: slicing, mapping types, ellipsis etc.

2004-11-29 Thread Bengt Richter
it certainly is self-explanatory. And, I appreciate your >response. > >However, my question pertains to advanced use of the slicing features >which I have found to be not totally explained in the docs. > >The use of [start:stop:step] on sequence types is NOT unclear to me at >all. &g

Re: slicing, mapping types, ellipsis etc.

2004-11-29 Thread Scott David Daniels
Jerry Sievers wrote: I'd like to know; 1. what the Ellipsis object or ... syntax is used for Use the Numeric (or numarray) package to really see these in use. Otherwise, you mostly get to implement it yourself. > 2. what a slice [..., j:k:l] does Again, see numeric. Essentially, select pa

Re: slicing, mapping types, ellipsis etc.

2004-11-29 Thread Steven Bethard
Jerry Sievers wrote: 1. what the Ellipsis object or ... syntax is used for 2. what a slice [..., j:k:l] does My understanding is that the Ellipsis object is intended primarily for Numeric/numarray use. Take a look at: http://stsdas.stsci.edu/numarray/numarray-1.1.html/node26.html 3. how slices

Re: slicing, mapping types, ellipsis etc.

2004-11-29 Thread Jerry Sievers
the slicing features which I have found to be not totally explained in the docs. The use of [start:stop:step] on sequence types is NOT unclear to me at all. I'd like to know; 1. what the Ellipsis object or ... syntax is used for 2. what a slice [..., j:k:l] does 3. how slices are applied t

Re: slicing, mapping types, ellipsis etc.

2004-11-29 Thread Caleb Hattingh
I'm going to assume the following is self-explanatory - type the commands in yourself. '>>> a = 'hello my name is caleb' '>>> b = a.split() '>>> b ['hello', 'my', 'name', 'is', 'caleb'] '>>> b[0] 'hello' '>>> b[1] 'my' '>>> b[0:1] ['hello'] '>>> b[0:2] ['hello', 'my'] '>>> b[-1] 'caleb' '>>> b[:

slicing, mapping types, ellipsis etc.

2004-11-29 Thread Jerry Sievers
Fellow Pythonists; I am totally puzzled on the use of slicing on mapping types and especially unsure on use of the Ellipsis... and slicing syntax that has two or more groups seperated by comma. I am referring to (from the manual); Slice objects Slice objects are used to