logo       

Re: [Python-Dev] Py_TPFLAGS_HEAPTYPE too overloaded: msg#00644

python-dev

Subject: Re: [Python-Dev] Py_TPFLAGS_HEAPTYPE too overloaded

Greg Ewing wrote:
> The only real concern would be if it were somehow possible to crash
> the interpreter by modifying the type dict. I don't see how that
> could happen -- but maybe someone else on python-dev knows more about
> this?

I believe a major part of the issue is that attempting to answer the
question "Will allowing mutating operation *X* on
object/type/float/int/etc create any interpreter stability or security
problems?" is awfully close to trying to prove a negative.

Certainly, at least some of the "generic" operations involving types
include additional sanity checks that are bypassed for the builtin types.

One specific example I can think of is that object.__hash__ is special
cased in a few places due to the way its definition interacts with the
definition of comparison operations. Allowing changes to the contents of
object's tp_hash slot could lead to much weirdness when it came to
__hash__ inheritance.

Cheers,
Nick.

--
Nick Coghlan | ncoghlan@xxxxxxxxx | Brisbane, Australia
---------------------------------------------------------------
_______________________________________________
Python-Dev mailing list
Python-Dev@xxxxxxxxxx
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/maillists%40codeha.us

Google Custom Search

News | Mail Home | sitemap | FAQ | advertise