1. 20 Feb, 2005 3 commits
    • Raymond Hettinger's avatar
      * Beef-up tests for str.count(). · 57e7447c
      Raymond Hettinger authored
      * Speed-up str.count() by using memchr() to fly between first char matches.
      57e7447c
    • Raymond Hettinger's avatar
      * Beef-up testing of str.__contains__() and str.find(). · 7cbf1bcb
      Raymond Hettinger authored
      * Speed-up "x in y" where x has more than one character.
      
      The existing code made excessive calls to the expensive memcmp() function.
      The new code uses memchr() to rapidly find a start point for memcmp().
      In addition to knowing that the first character is a match, the new code
      also checks that the last character is a match.  This significantly reduces
      the incidence of false starts (saving memcmp() calls and making quadratic
      behavior less likely).
      
      Improves the timings on:
          python -m timeit -r7 -s"x='a'*1000" "'ab' in x"
          python -m timeit -r7 -s"x='a'*1000" "'bc' in x"
      
      Once this code has proven itself, then string_find_internal() should refer
      to it rather than running its own version.  Also, something similar may
      apply to unicode objects.
      7cbf1bcb
    • Guido van Rossum's avatar
      54c273c7
  2. 19 Feb, 2005 1 commit
    • Ka-Ping Yee's avatar
      Use getdoc(object) instead of object.__doc__ to fix indentation problems. · bba6acc7
      Ka-Ping Yee authored
      Thanks to Robert Dick <dickrp@ece.northwestern.edu> for reporting this bug
      and submitting a patch.
      
      Adjust doc(object) to display useful documentation for plain values (e.g.
      help([]) now shows the methods on the list instead of just printing "[]").
      
      (This change has been tested interactively, by generating docs for the
      standard library, and by running the module documentation webserver.)
      bba6acc7
  3. 18 Feb, 2005 5 commits
  4. 17 Feb, 2005 10 commits
  5. 16 Feb, 2005 2 commits
  6. 15 Feb, 2005 4 commits
  7. 14 Feb, 2005 1 commit
  8. 13 Feb, 2005 2 commits
  9. 11 Feb, 2005 1 commit
  10. 10 Feb, 2005 6 commits
  11. 09 Feb, 2005 3 commits
  12. 08 Feb, 2005 2 commits