On Mon, Dec 27, 2010 at 11:52 AM, Terry Reedy wrote:
> Return a converted to an integer. Equivalent to a.__index__()."
> comes close to implying equality (if possible).
>
> What are the actual used of .__index__?
PEP 357 gives the original rationale - it was to allow integer-like
objects (such as
> What are the actual used of .__index__?
Can you please rephrase this question?
Regards,
Martin
___
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/py
On 12/26/2010 7:01 PM, Nick Coghlan wrote:
Yes, the definition in the language reference could definitely be
improved to mention the semantics first, and then reference
operator.index second.
Possible wording "Indicates to the Python interpreter that the object
is semantically equivalent to the
On 12/26/2010 7:15 PM, Nick Coghlan wrote:
Starting in Python 3.2, range() supports fast containment checking for
integers (i.e. based on an O(1) arithmetic calculation rather than an
O(N) iteration through the entire sequence).
Currently, this fast path ignores objects that implement __index__
On Mon, Dec 27, 2010 at 9:34 AM, Benjamin Peterson wrote:
> 2010/12/26 Sven Brauch :
>> In that discussion, there's been different opinions about which
>> behaviour is better; main arguments were "consistency" for the current
>> and "usefulness" for the suggested behaviour. It has been proposed to
Starting in Python 3.2, range() supports fast containment checking for
integers (i.e. based on an O(1) arithmetic calculation rather than an
O(N) iteration through the entire sequence).
Currently, this fast path ignores objects that implement __index__ -
they are relegated to the slow iterative se
Hey,
yeah, you're right, that would be even better. Currently it would also
give a 3 for bar in "foo.bar.baz". I'd be fine with both
solutions, but yours seems more logical.
Bye,
Sven
2010/12/27 Glenn Linderman :
> On 12/26/2010 1:41 PM, Sven Brauch wrote:
>
> Hi there,
>
> I recently filed
On Mon, Dec 27, 2010 at 8:57 AM, Victor Stinner
wrote:
> Le dimanche 26 décembre 2010 à 14:10 +, exar...@twistedmatrix.com a
> écrit :
>> On 25 Dec, 10:31 pm, mer...@netwok.org wrote:
>> >>faulthandler is a module: enable the handler is simple as "import
>> >>faulthandler".
>> >
>> >That sound
On 12/26/2010 1:41 PM, Sven Brauch wrote:
Hi there,
I recently filed a feature request in the tracker to change the
behaviour of the parser in terms of setting ranges on attribute AST
nodes, because I'm working on an application which needs more
information than is currently provided. I suggeste
On Mon, Dec 27, 2010 at 3:13 AM, Éric Araujo wrote:
> Le 24/12/2010 02:08, Nick Coghlan a écrit :
>> On Fri, Dec 24, 2010 at 4:41 AM, eric.araujo
>> wrote:
>>> Fix small inaccuracy: there is no index function
>>
>> Yes, there is, it just isn't a builtin - it lives in the operator module.
> Defin
It should maybe be noted that the proposed patch would change that,
too, so it would be the same behaviour for all three types
(subscripts, calls, and attributes) again. Just more intuitive. :)
2010/12/27 Benjamin Peterson :
> 2010/12/26 Sven Brauch :
>> Hi there,
>>
>> I recently filed a feature
2010/12/26 Sven Brauch :
> Hi there,
>
> I recently filed a feature request in the tracker to change the
> behaviour of the parser in terms of setting ranges on attribute AST
> nodes, because I'm working on an application which needs more
> information than is currently provided. I suggested to cha
Le dimanche 26 décembre 2010 à 14:10 +, exar...@twistedmatrix.com a
écrit :
> On 25 Dec, 10:31 pm, mer...@netwok.org wrote:
> >>faulthandler is a module: enable the handler is simple as "import
> >>faulthandler".
> >
> >That sounds like a source of unwanted behavior (aka problems) if the
> >han
Hi there,
I recently filed a feature request in the tracker to change the
behaviour of the parser in terms of setting ranges on attribute AST
nodes, because I'm working on an application which needs more
information than is currently provided. I suggested to change the
behaviour from
foo.bar.baz #
On 12/24/2010 02:03 PM, Raymond Hettinger wrote:
On Dec 24, 2010, at 10:56 AM, Terry Reedy wrote:
On 12/24/2010 11:09 AM, Michael Foord wrote:
On 22/12/2010 02:26, Terry Reedy wrote:
On 12/21/2010 7:17 AM, Michael Foord wrote:
My first priority is that doc and code match.
Close second is
Le 24/12/2010 02:08, Nick Coghlan a écrit :
> On Fri, Dec 24, 2010 at 4:41 AM, eric.araujo
> wrote:
>> Fix small inaccuracy: there is no index function
>
> Yes, there is, it just isn't a builtin - it lives in the operator module.
Defining object.__index__ with operator.index seems pretty circula
On 25 Dec, 10:31 pm, mer...@netwok.org wrote:
faulthandler is a module: enable the handler is simple as "import
faulthandler".
That sounds like a source of unwanted behavior (aka problems) if the
handler is enabled by 1Cpydoc faulthandler 1D or by a pkgutil walk. You
may want to consider usin
17 matches
Mail list logo