A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2002-January/019176.html below:

Re [Python-Dev] object equality vs identity, in and dicts idioms and speed

Re [Python-Dev] object equality vs identity, in and dicts idioms and speedFinn Bock bckfnn@worldonline.dk
Fri, 04 Jan 2002 22:11:29 GMT
[Martin v. Loewis]

>I understand Samuele was talking about mapping in the Python sense
>(existance of dictionary-style containers); he also mentioned that
>Jython creates a Python wrapper object for each "foreign" Java object.

Your summery is quite accurate.

When this was discussed on jython-dev, I said I preferred a solution
where all objects was inserted in your "map" dictionary when id() was
called on them. Not just the wrapped java instances. I picked that
preference because I think using id() is a relative uncommon operation.
In the Lib modules, id() is used to detect cycles in copy.py, pickle.py,
pprint.py and xmlrpclib. I would rather have a slow id() operation on
python objects too, than burden all python objects with an additional
int or long.

Is that a wrong call?

In the repr() of a lot of internal objects, the id() is used in the
return string. Would anyone rightly expect that hex number to match the
id() value of the object? In our discussions we agreed that the repr()
string does not have to match the value return by id().

regards,
finn



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4