[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
While discussing Python issue #12067 (http://bugs.python.org/issue12067#msg222442), I learned that Python 3.4 implements '==' and '!=' on the object type such that if no special equality test operations are implemented in derived classes, there is a default implementation that tests for identit

[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
Am 07.07.2014 17:15, schrieb Benjamin Peterson: On Mon, Jul 7, 2014, at 04:22, Andreas Maier wrote: Python 2.x does not seem to have such a default implementation; == and != raise an exception if attempted on objects that don't implement equality in derived classes. Why do you think

[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
Am 07.07.2014 17:58, schrieb Xavier Morel: On 2014-07-07, at 13:22 , Andreas Maier wrote: While discussing Python issue #12067 (http://bugs.python.org/issue12067#msg222442), I learned that Python 3.4 implements '==' and '!=' on the object type such that if no sp

[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
Am 07.07.2014 17:55, schrieb Ethan Furman: On 07/07/2014 04:22 AM, Andreas Maier wrote: Where is the discrepancy between the documentation of == and its default implementation on object documented? There's seems to be no discrepancy (at least, you have not shown it), The document

[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
Am 2014-07-07 19:43, schrieb Ethan Furman: On 07/07/2014 09:56 AM, Andreas Maier wrote: Am 07.07.2014 17:55, schrieb Ethan Furman: On 07/07/2014 04:22 AM, Andreas Maier wrote: Where is the discrepancy between the documentation of == and its default implementation on object documented

[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
Am 2014-07-07 23:11, schrieb Jan Kaliszewski: 07.07.2014 18:11, Andreas Maier wrote: Am 07.07.2014 17:58, schrieb Xavier Morel: On 2014-07-07, at 13:22 , Andreas Maier wrote: While discussing Python issue #12067 (http://bugs.python.org/issue12067#msg222442), I learned that Python 3.4

[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
Am 2014-07-07 23:31, schrieb Rob Cliffe: On 07/07/2014 22:11, Jan Kaliszewski wrote: [snip] IMHO, in Python context, "value" is a very vague term. Quite often we can read it as the very basic (but not the only one) notion of "what makes objects being equal or not" -- and then saying that "o

[Python-Dev] == on object tests identity in 3.x - summary

2014-07-07 Thread Andreas Maier
Thanks to all who responded. In absence of class-specific equality test methods, the default implementations revert to use the identity (=address) of the object as a basis for the test, in both Python 2 and Python 3. In absence of specific ordering test methods, the default implementations r

[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
Am 2014-07-08 01:49, schrieb Benjamin Peterson: On Mon, Jul 7, 2014, at 16:36, Andreas Maier wrote: Am 2014-07-07 19:43, schrieb Ethan Furman: On 07/07/2014 09:56 AM, Andreas Maier wrote: Am 07.07.2014 17:55, schrieb Ethan Furman: On 07/07/2014 04:22 AM, Andreas Maier wrote: Where is the

[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
Am 2014-07-07 18:09, schrieb Ethan Furman: Just because two instances from the same object have the same value does not mean they are equal. For a real-life example, look at twins: biologically identical, yet not equal. I think they *are* equal in Python if they have the same value, by def

[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
Am 2014-07-08 01:50, schrieb Ethan Furman: On 07/07/2014 04:36 PM, Andreas Maier wrote: Am 2014-07-07 19:43, schrieb Ethan Furman: Python cannot know which values are important in an equality test, and which are not. So it refuses to guess. Well, one could argue that using the address of

[Python-Dev] == on object tests identity in 3.x

2014-07-07 Thread Andreas Maier
Am 2014-07-08 02:22, schrieb Ethan Furman: On 07/07/2014 05:12 PM, Andreas Maier wrote: Am 2014-07-07 18:09, schrieb Ethan Furman: Just because two instances from the same object have the same value does not mean they are equal. For a real-life example, look at twins: biologically

[Python-Dev] == on object tests identity in 3.x

2014-07-11 Thread Andreas Maier
Am 09.07.2014 03:48, schrieb Raymond Hettinger: On Jul 7, 2014, at 4:37 PM, Andreas Maier wrote: I do not really buy into the arguments that try to show how identity and value are somehow the same. They are not, not even in Python. The argument I can absolutely buy into is that the

[Python-Dev] == on object tests identity in 3.x - uploaded doc patch

2014-07-11 Thread Andreas Maier
Am 11.07.2014 10:54, schrieb Ethan Furman: On 07/11/2014 01:51 AM, Andreas Maier wrote: I like the motivation provided by Benjamin and will work it into the doc patch for issue #12067. The NaN special case will also stay in. Cool -- you should nosy myself, D'Aprano, and Benjamin (at leas

[Python-Dev] == on object tests identity in 3.x

2014-07-11 Thread Andreas Maier
Am 08.07.2014 05:47, schrieb Ethan Furman: On 07/07/2014 08:34 PM, Stephen J. Turnbull wrote: Ethan Furman writes: And what would be this 'sensible definition' [of value equality]? I think that's the wrong question. I suppose Andreas's point is that when the programmer doesn't provide a def

[Python-Dev] == on object tests identity in 3.x - list delegation to members?

2014-07-13 Thread Andreas Maier
Am 11.07.2014 22:54, schrieb Ethan Furman: On 07/11/2014 07:04 AM, Andreas Maier wrote: Am 09.07.2014 03:48, schrieb Raymond Hettinger: Personally, I see no need to make the same mistake by removing the identity-implies-equality rule from the built-in containers. There's no need to upse

[Python-Dev] == on object tests identity in 3.x - list delegation to members?

2014-07-14 Thread Andreas Maier
Am 14.07.2014 04:55, schrieb Ethan Furman: On 07/13/2014 08:13 AM, Andreas Maier wrote: Test #8: Same object of class C (C.__eq__() implemented with equality of x, C.__ne__() returning NotImplemented): obj1: type=, str=C(256), id=39406504 obj2: type=, str=C(256), id=39406504

[Python-Dev] == on object tests identity in 3.x - list delegation to members?

2014-07-16 Thread Andreas Maier
Am 13.07.2014 18:23, schrieb Steven D'Aprano: On Sun, Jul 13, 2014 at 05:13:20PM +0200, Andreas Maier wrote: Second, if not by delegation to equality of its elements, how would the equality of sequences defined otherwise? Wow. I'm impressed by the amount of detailed effort you&#

[Python-Dev] == on object tests identity in 3.x - list delegation to members?

2014-07-16 Thread Andreas Maier
Am 13.07.2014 22:05, schrieb Akira Li: Nick Coghlan writes: ... definition of floats and the definition of container invariants like "assert x in [x]") The current approach means that the lack of reflexivity of NaN's stays confined to floats and similar types - it doesn't leak out and infect t

[Python-Dev] == on object tests identity in 3.x - uploaded patch v9

2014-07-16 Thread Andreas Maier
Am 16.07.2014 13:40, schrieb Andreas Maier: Am 13.07.2014 22:05, schrieb Akira Li: Nick Coghlan writes: ... There was related issue "Tuple comparisons with NaNs are broken" http://bugs.python.org/issue21873 but it was closed as "not a bug" despite the corresponding behavio

[Python-Dev] Review needed for patch for issue #12067

2014-08-18 Thread Andreas Maier
Hello, a patch for issue #12067 (targeting Py 3.5) is available since a few weeks and is ready for review. From my perspective, it is ready for commit. Could the community please review the patch? https://bugs.python.org/issue12067 Thanks, Andy ___

[Python-Dev] isinstance() on old-style classes in Py 2.7

2014-10-21 Thread Andreas Maier
'__getattribute__', '__hash__', '__init__', '__new__', '__reduce__ ', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__'] -> What is the motivation for isin

[Python-Dev] Dependent packages not listed on PyPI

2016-04-19 Thread Andreas Maier
Hi, I have a package "pywbem" which in its setup script specifies a number of dependent packages via "install_requires". I should also say that it extends setuptools/distutils with its own additional keywords, e.g. it adds a "develop_requires", but I believe (hope) that is irrelevant for my p