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/2003-November/039969.html below:

[Python-Dev] test warnings for "%x"%id(foo) on 2.3 branch

[Python-Dev] test warnings for "%x"%id(foo) on 2.3 branch [Python-Dev] test warnings for "%x"%id(foo) on 2.3 branchMartin v. Löwis martin at v.loewis.de
Tue Nov 4 16:51:49 EST 2003
Anthony Baxter <anthony at interlink.com.au> writes:

> I'm seeing a couple of warnings that I don't remember seeing at
> the time of the 2.3.2 release. Given what they are, it's possible
> that it's just a random thing (whether the id is < 0 or not).

What system is this on? I find it surprising that the id is < 0: on a
32-bit machine, this should only happen if you allocate more than 2GB.

> Anyone want to suggest an appropriate fix, or fix them? Otherwise I'll
> put it on the to-do list.

I'd reformulate them as 

"%x" % (id(o) & 0xffffffffL)

Of course, you have to replace 0xffffffffL with (unsigned)-1 of the
system (i.e. 2l*sys.maxint+1). I wonder whether creating a function

sys.unsigned(id(o))

would be appropriate, which returns its arguments for positive
numbers, and PyLong_FromUnsignedLong((unsigned)arg) otherwise.

Regards,
Martin


More information about the Python-Dev mailing list

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