1. 14 Sep, 2001 2 commits
    • Tim Peters's avatar
      The end of [#460467] file objects should be subclassable. · 4441001b
      Tim Peters authored
      A surprising number of changes to split tp_new into tp_new and tp_init.
      Turned out the older PyFile_FromFile() didn't initialize the memory it
      allocated in all (error) cases, which caused new sanity asserts
      elsewhere to fail left & right (and could have, e.g., caused file_dealloc
      to try decrefing random addresses).
      4441001b
    • Tim Peters's avatar
      Changed the dict implementation to take "string shortcuts" only when · 0ab085c4
      Tim Peters authored
      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
  2. 13 Sep, 2001 11 commits
  3. 12 Sep, 2001 10 commits
  4. 11 Sep, 2001 17 commits