• Tim Peters's avatar
    Changed the dict implementation to take "string shortcuts" only when · 0ab085c4
    Tim Peters yazdı
    keys are true strings -- no subclasses need apply.  This may be debatable.
    
    The problem is that a str subclass may very well want to override __eq__
    and/or __hash__ (see the new example of case-insensitive strings in
    test_descr), but go-fast shortcuts for strings are ubiquitous in our dicts
    (and subclass overrides aren't even looked for then).  Another go-fast
    reason for the change is that PyCheck_StringExact() is a quicker test
    than PyCheck_String(), and we make such a test on virtually every access
    to every dict.
    
    OTOH, a str subclass may also be perfectly happy using the base str eq
    and hash, and this change slows them a lot.  But those cases are still
    hypothetical, while Python's own reliance on true-string dicts is not.
    0ab085c4
Adı
Son kayıt (commit)
Son güncelleme
Demo Loading commit data...
Doc Loading commit data...
Grammar Loading commit data...
Include Loading commit data...
Lib Loading commit data...
Mac Loading commit data...
Misc Loading commit data...
Modules Loading commit data...
Objects Loading commit data...
PC Loading commit data...
PCbuild Loading commit data...
Parser Loading commit data...
Python Loading commit data...
RISCOS Loading commit data...
Tools Loading commit data...
.cvsignore Loading commit data...
.hgtags Loading commit data...
LICENSE Loading commit data...
Makefile.pre.in Loading commit data...
PLAN.txt Loading commit data...
README Loading commit data...
acconfig.h Loading commit data...
configure Loading commit data...
configure.in Loading commit data...
install-sh Loading commit data...
pyconfig.h.in Loading commit data...
setup.py Loading commit data...