Neil Schemenauer wrote: > > On Mon, Nov 06, 2000 at 01:25:26PM +0100, M.-A. Lemburg wrote: > > I think the problem we currently have with subclassing types > > is strongly related to the fact that all Py<type>_Check() > > macros only work on a address compare basis. > > I don't think this is the problem, although it is closely > related. The problem is that the interpreter uses these type > checks to special case the handling of certain types. > PyInstance_Check() is a big offender. > > Behavior should be based solely on the type structure. Extension > types would then be able to behave exactly like any other builtin > type. Your coercion proposal and David's rich comparisions both > remove some of this special casing based on type. Even though this could remove some of the problems, it doesn't help much with a common use of Py<Type>_Check(): that of using fast access macros and native Py<Type>_*() APIs once an object has been classified as being of a certain type. This usually improves performance. By changing the simple address compare to a type handle system, we might be able to add some more flexibility to the system while keeping b/w compatibility. -- Marc-Andre Lemburg ______________________________________________________________________ Business: http://www.lemburg.com/ Python Pages: http://www.lemburg.com/python/
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