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/019126.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 speed Re [Python-Dev] object equality vs identity, in and dicts idioms and speedSamuele Pedroni Samuele Pedroni" <pedroni@inf.ethz.ch
Fri, 4 Jan 2002 04:11:00 +0100
[Tim Peters] 
> Mapping what to what?  A fine implementation of id() would be to hand each
> new object a unique Java int from a global counter, incremented once per
> Python object creation -- or a Java long if any JVM stays up long enough
> that 32 bits is an issue <wink>.
 
The problem are java class instances, sir,
we use non-unique wrappers for them and identity is simulated.
We could use a table to make the wrappers unique but we have
potentially lots of them as you can imagine, jython people
actually use java classes <wink>. So the workaround
is to keep a table just for the java instances for which
someone has asked the id. We cannot win-win so
we try not to lose-lose.  For simplicity we will
extend the table approach to everything.
If you have a win-win solution also in this case please ...
Our goal is compatibility but we will suggest 
to avoid id as far as possible for production jython
code ...
 
regards  





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