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
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
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
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
--
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
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 =
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
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
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.
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
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
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
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
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
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
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())
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, **
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
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
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
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
(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
Done.
--
http://mail.python.org/mailman/listinfo/python-list
I would file a bug report/documentation bug/feature
request or whatever to sourceforge.
Michele Simionato
--
http://mail.python.org/mailman/listinfo/python-list
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 ..
I think doctest believes the line starting with ... is
a continuation line in a multiline statement.
--
http://mail.python.org/mailman/listinfo/python-list
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
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
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
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
; 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
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
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
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
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
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[:
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
37 matches
Mail list logo