On 11/01/2014 11:29 AM, Ethan Furman wrote:
But I agree with Net ...
Oops, should have ben 'Ned' -- apologies!
--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list
mutable, so I can't
>>> inherit from long. I thought I'd found the answer when I came across
>>> __index__, it doesn't seem to work as I expected it to.
>>
>> Just above your link in the docs is __oct__ and __hex__, which are
>> used to implement oct()
ame across
__index__, it doesn't seem to work as I expected it to.
Just above your link in the docs is __oct__ and __hex__, which are used to
implement oct() and hex():
https://docs.python.org/2/reference/datamodel.html#object.__oct__
In Python 2 __oct__ and __hex__ are used for oct() an
On 01/11/14 16:56, duncan smith wrote:
[snip]
Sorry, forgot to add that I'm using Python 2.7.6 on Ubuntu 14.04. Cheers.
Duncan
--
https://mail.python.org/mailman/listinfo/python-list
On 11/1/14 12:56 PM, duncan smith wrote:
Hello,
I have a Bloom filter class and want to (partially) serialize
instances using hex() or oct(). Instances are mutable, so I can't
inherit from long. I thought I'd found the answer when I came across
__index__,
https://docs.py
Hello,
I have a Bloom filter class and want to (partially) serialize
instances using hex() or oct(). Instances are mutable, so I can't
inherit from long. I thought I'd found the answer when I came across
__index__,
https://docs.python.org/2/reference/datamodel.html#object.__index
On Jun 24, 4:19 pm, schickb <[EMAIL PROTECTED]> wrote:
> On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote:
>
>
>
> > > I think it would be useful if iterators on sequences had the __index__
> > > method so that they could be used to slice sequences.
On Jun 24, 4:19 pm, schickb <[EMAIL PROTECTED]> wrote:
> On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote:
>
>
>
> > > I think it would be useful if iterators on sequences had the __index__
> > > method so that they could be used to slice sequences.
On Jun 25, 12:11 am, schickb <[EMAIL PROTECTED]> wrote:
>
> But this isn't just about slicing. I'd like sequence iterators to be
> usable as simple indexes as well; like a[it] (which __index__ would
> also provide).
It occurred to me that this wouldn't need to
ers. There is no way for obj1 and obj2 to tell Python that they
could be reasonably used as indexes into a sequence. This is an
unnecessary limitation."
But this isn't just about slicing. I'd like sequence iterators to be
usable as simple indexes as well; like a[it] (which __index_
schickb wrote:
On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote:
I think it would be useful if iterators on sequences had the __index__
method so that they could be used to slice sequences. I was writing a
class and wanted to return a list iterator to callers. I then wanted
On Jun 24, 3:45 pm, Matimus <[EMAIL PROTECTED]> wrote:
>
> > I think it would be useful if iterators on sequences had the __index__
> > method so that they could be used to slice sequences. I was writing a
> > class and wanted to return a list iterator to callers. I the
On Jun 24, 3:29 pm, schickb <[EMAIL PROTECTED]> wrote:
> I think it would be useful if iterators on sequences had the __index__
> method so that they could be used to slice sequences. I was writing a
> class and wanted to return a list iterator to callers. I then wanted
> to
I think it would be useful if iterators on sequences had the __index__
method so that they could be used to slice sequences. I was writing a
class and wanted to return a list iterator to callers. I then wanted
to let callers slice from an iterator's position, but that isn't
support
14 matches
Mail list logo