A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2004-March/043371.html below:

[Python-Dev] Two possible fixes for isinstance nested tuples

[Python-Dev] Two possible fixes for isinstance nested tuples [Python-Dev] Two possible fixes for isinstance nested tuplesBrett Cannon bac at OCF.Berkeley.EDU
Sat Mar 20 11:09:16 EST 2004
Bug #858016 brought up the issue of deeply nested tuples of classes
segfaulting isinstance and issubclass.  There is a patch with the bug
report that adds a check to make sure the tuple is completely shallow.

For Python 2.3, though, that doesn't work since it breaks code.  So I have
coded up something that calls Py_GetRecursionLimit and makes sure the
depth never goes past that.

The question is which solution to use for  Python 2.4 .  I did some
benchmarking on as-is and with the recursion check and the performance
difference is no worse than 2% (granted this was before I made the
recursion functions static, but that should  just help performance).
Would people rather do the recursion check or force people to use a
shallow tuple in 2.4?

-Brett

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