Commit Graph

53 Commits

Author SHA1 Message Date
Serhiy Storchaka fe3dc376fa Issue #19104: pprint now produces evaluable output for wrapped strings. 2014-12-20 20:57:15 +02:00
Antoine Pitrou 7d36e2fc5c Remove builtin "caching" in pprint 2013-10-03 21:29:36 +02:00
Serhiy Storchaka 57d5c08966 Use cached builtins. 2013-10-02 19:15:54 +03:00
Serhiy Storchaka 7c411a4041 Issue #19132: The pprint module now supports compact mode. 2013-10-02 11:56:18 +03:00
Serhiy Storchaka 092bd388ce Issue #19137: The pprint module now correctly formats instances of set and
frozenset subclasses.
2013-10-02 11:43:30 +03:00
Serhiy Storchaka 51844384f4 Issue #19137: The pprint module now correctly formats instances of set and
frozenset subclasses.
2013-10-02 11:40:49 +03:00
Antoine Pitrou 64c16c3311 Issue #17150: pprint now uses line continuations to wrap long string literals. 2013-03-23 20:30:39 +01:00
Florent Xicluna d6da90f93d Issues #10017 and #14998: Fix TypeError using pprint on dictionaries with unorderable key. 2012-07-21 11:17:38 +02:00
Raymond Hettinger bad3c88094 Have pprint() respect the order in an OrderedDict. 2010-09-09 12:31:00 +00:00
Raymond Hettinger a7da1663ec Issue 3976: fix pprint for sets, frozensets, and dicts containing unorderable types. 2009-11-19 01:07:05 +00:00
Alexandre Vassalotti eca20b6114 Merged revisions 63119-63128,63130-63131,63133,63135-63144,63146-63148,63151-63152,63155-63165,63167-63176,63181-63186,63188-63189 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r63119 | benjamin.peterson | 2008-05-11 20:41:23 -0400 (Sun, 11 May 2008) | 2 lines

  #2196 hasattr now allows SystemExit and KeyboardInterrupt to propagate
........
  r63122 | benjamin.peterson | 2008-05-11 20:46:49 -0400 (Sun, 11 May 2008) | 2 lines

  make message slightly more informative, so there's no chance of misunderstanding it
........
  r63158 | ronald.oussoren | 2008-05-12 07:24:33 -0400 (Mon, 12 May 2008) | 5 lines

  Remove references to platform 'mac'

  The 'mac' platform (that is, os.name == 'mac') was used for the MacOS 9 port,
  which is no longer supported (as of Python 2.4 IIRC).
........
  r63159 | ronald.oussoren | 2008-05-12 07:31:05 -0400 (Mon, 12 May 2008) | 8 lines

  MacOSX: remove dependency on Carbon package for urllib

  This patch removes the dependency on the Carbon package from urllib.
  The mac-specific code for getting proxy configuration is now writting in
  Python using ctypes and uses the SystemConfiguration framework instead of
  InternetConfig. Also provides a mac-specific implementation of proxy_bypass.
........
  r63162 | eric.smith | 2008-05-12 10:00:01 -0400 (Mon, 12 May 2008) | 1 line

  Added 'n' presentation type for integers.
........
  r63164 | georg.brandl | 2008-05-12 12:26:52 -0400 (Mon, 12 May 2008) | 2 lines

  #1713041: fix pprint's handling of maximum depth.
........
  r63170 | georg.brandl | 2008-05-12 12:53:42 -0400 (Mon, 12 May 2008) | 2 lines

  Fix parameter name for enumerate().
........
  r63173 | georg.brandl | 2008-05-12 13:01:58 -0400 (Mon, 12 May 2008) | 2 lines

  #2766: remove code without effect.
........
  r63174 | georg.brandl | 2008-05-12 13:04:10 -0400 (Mon, 12 May 2008) | 3 lines

  #2767: don't clear globs in run() call, since they could be needed in tearDown,
  which clears them at the end.
........
  r63175 | georg.brandl | 2008-05-12 13:14:51 -0400 (Mon, 12 May 2008) | 2 lines

  #1760: try-except-finally is one statement since PEP 341.
........
  r63186 | amaury.forgeotdarc | 2008-05-12 17:30:24 -0400 (Mon, 12 May 2008) | 2 lines

  Sync code with documentation, and remove Win95 support in winsound module.
........
  r63189 | amaury.forgeotdarc | 2008-05-12 18:21:39 -0400 (Mon, 12 May 2008) | 3 lines

  Adapt test_pyclbr to the new version of urllib.py:
  The new mac-specific functions must be ignored.
........
2008-05-16 02:54:33 +00:00
Raymond Hettinger 4b8db419c2 Update pprint() to match the new repr style for frozensets 2008-01-31 01:10:03 +00:00
Christian Heimes 969fe57baa Merged revisions 60245-60277 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r60246 | guido.van.rossum | 2008-01-24 18:58:05 +0100 (Thu, 24 Jan 2008) | 2 lines

  Fix test67.py from issue #1303614.
........
  r60248 | raymond.hettinger | 2008-01-24 19:05:54 +0100 (Thu, 24 Jan 2008) | 1 line

  Clean-up and speed-up code by accessing numerator/denominator directly.  There's no reason to enforce readonliness
........
  r60249 | raymond.hettinger | 2008-01-24 19:12:23 +0100 (Thu, 24 Jan 2008) | 1 line

  Revert 60189 and restore performance.
........
  r60250 | guido.van.rossum | 2008-01-24 19:21:02 +0100 (Thu, 24 Jan 2008) | 5 lines

  News about recently fixed crashers:
  - A few crashers fixed: weakref_in_del.py (issue #1377858);
    loosing_dict_ref.py (issue #1303614, test67.py);
    borrowed_ref_[34].py (not in tracker).
........
  r60252 | thomas.heller | 2008-01-24 19:36:27 +0100 (Thu, 24 Jan 2008) | 7 lines

  Use a PyDictObject again for the array type cache; retrieving items
  from the WeakValueDictionary was slower by nearly a factor of 3.

  To avoid leaks, weakref proxies for the array types are put into the
  cache dict, with weakref callbacks that removes the entries when the
  type goes away.
........
  r60253 | thomas.heller | 2008-01-24 19:54:12 +0100 (Thu, 24 Jan 2008) | 2 lines

  Replace Py_BuildValue with PyTuple_Pack because it is faster.
  Also add a missing DECREF.
........
  r60254 | raymond.hettinger | 2008-01-24 20:05:29 +0100 (Thu, 24 Jan 2008) | 1 line

  Add support for trunc().
........
  r60255 | thomas.heller | 2008-01-24 20:15:02 +0100 (Thu, 24 Jan 2008) | 5 lines

  Invert the checks in get_[u]long and get_[u]longlong.  The intent was
  to not accept float types; the result was that integer-like objects
  were not accepted.

  Ported from release25-maint.
........
  r60256 | raymond.hettinger | 2008-01-24 20:30:19 +0100 (Thu, 24 Jan 2008) | 1 line

  Add support for int(r) just like the other numeric classes.
........
  r60263 | raymond.hettinger | 2008-01-24 22:23:58 +0100 (Thu, 24 Jan 2008) | 1 line

  Expand tests to include nested graph structures.
........
  r60264 | raymond.hettinger | 2008-01-24 22:47:56 +0100 (Thu, 24 Jan 2008) | 1 line

  Shorter pprint's for empty sets and frozensets.  Fix indentation of frozensets.  Add tests including two complex data structures.
........
  r60265 | amaury.forgeotdarc | 2008-01-24 23:51:18 +0100 (Thu, 24 Jan 2008) | 14 lines

  #1920: when considering a block starting by "while 0", the compiler optimized the
  whole construct away, even when an 'else' clause is present::

      while 0:
          print("no")
      else:
          print("yes")

  did not generate any code at all.

  Now the compiler emits the 'else' block, like it already does for 'if' statements.

  Will backport.
........
  r60266 | amaury.forgeotdarc | 2008-01-24 23:59:25 +0100 (Thu, 24 Jan 2008) | 2 lines

  News entry for r60265 (Issue 1920).
........
  r60269 | raymond.hettinger | 2008-01-25 00:50:26 +0100 (Fri, 25 Jan 2008) | 1 line

  More code cleanup.  Remove unnecessary indirection to useless class methods.
........
  r60270 | raymond.hettinger | 2008-01-25 01:21:54 +0100 (Fri, 25 Jan 2008) | 1 line

  Add support for copy, deepcopy, and pickle.
........
  r60271 | raymond.hettinger | 2008-01-25 01:33:45 +0100 (Fri, 25 Jan 2008) | 1 line

  Mark todos and review comments.
........
  r60272 | raymond.hettinger | 2008-01-25 02:13:12 +0100 (Fri, 25 Jan 2008) | 1 line

  Add one other review comment.
........
  r60273 | raymond.hettinger | 2008-01-25 02:23:38 +0100 (Fri, 25 Jan 2008) | 1 line

  Fix-up signature for approximation.
........
  r60274 | raymond.hettinger | 2008-01-25 02:46:33 +0100 (Fri, 25 Jan 2008) | 1 line

  More design notes
........
  r60276 | neal.norwitz | 2008-01-25 07:37:23 +0100 (Fri, 25 Jan 2008) | 6 lines

  Make the test more robust by trying to reconnect up to 3 times
  in case there were transient failures.  This will hopefully silence
  the buildbots for this test.  As we find other tests that have a problem,
  we can fix with a similar strategy assuming it is successful.  It worked
  on my box in a loop for 10+ runs where it would have an exception otherwise.
........
  r60277 | neal.norwitz | 2008-01-25 09:04:16 +0100 (Fri, 25 Jan 2008) | 4 lines

  Add prototypes to get the mathmodule.c to compile on OSF1 5.1 (Tru64)
  and eliminate a compiler warning in floatobject.c.  There might be
  a better way to go about this, but it should be good enough for now.
........
2008-01-25 11:23:10 +00:00
Christian Heimes 1af737cd1e Merged revisions 60176-60209 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r60178 | georg.brandl | 2008-01-21 22:05:49 +0100 (Mon, 21 Jan 2008) | 2 lines

  #1715: include sub-extension modules in pydoc text output.
........
  r60179 | georg.brandl | 2008-01-21 22:14:21 +0100 (Mon, 21 Jan 2008) | 2 lines

  Add a "const" to make gcc happy.
........
  r60180 | georg.brandl | 2008-01-21 22:19:07 +0100 (Mon, 21 Jan 2008) | 2 lines

  Add the correct build dir when building with pydebug.
........
  r60181 | georg.brandl | 2008-01-21 22:23:15 +0100 (Mon, 21 Jan 2008) | 3 lines

  Patch #1720595: add T_BOOL to the range of structmember types.
  Patch by Angelo Mottola, reviewed by MvL, tests by me.
........
  r60182 | georg.brandl | 2008-01-21 22:28:32 +0100 (Mon, 21 Jan 2008) | 2 lines

  Reformat some ugly code.
........
  r60187 | brett.cannon | 2008-01-22 00:50:16 +0100 (Tue, 22 Jan 2008) | 4 lines

  Make's MAKEFLAGS variable is set to a string containing the single-letter
  arguments to Make. This means there are no hyphens. Fix the '-s' check to
  silence distutils to now work.
........
  r60188 | gregory.p.smith | 2008-01-22 01:19:41 +0100 (Tue, 22 Jan 2008) | 3 lines

  accepts and closes issue #1221598: adds an optional callback to ftplib.FTP
  storbinary() and storlines() methods.
........
  r60189 | gregory.p.smith | 2008-01-22 02:12:02 +0100 (Tue, 22 Jan 2008) | 2 lines

  Replace spam.acquire() try: ... finally: spam.release() with "with spam:"
........
  r60190 | gregory.p.smith | 2008-01-22 02:20:42 +0100 (Tue, 22 Jan 2008) | 4 lines

  - Fix Issue #1703448: A joined thread could show up in the
    threading.enumerate() list after the join() for a brief period until
    it actually exited.
........
  r60193 | georg.brandl | 2008-01-22 08:53:31 +0100 (Tue, 22 Jan 2008) | 2 lines

  Fix \xhh specs, #1889.
........
  r60198 | christian.heimes | 2008-01-22 16:01:25 +0100 (Tue, 22 Jan 2008) | 1 line

  Fixed a missing (X) in define
........
  r60199 | christian.heimes | 2008-01-22 16:25:18 +0100 (Tue, 22 Jan 2008) | 2 lines

  Don't repeat yourself
  Added the macros PyModule_AddIntMacro and PyModule_AddStringMacro. They shorten PyModule_AddIntConstant(m, "AF_INET", AF_INET) to PyModule_AddIntMacro(m, AF_INET)
........
  r60201 | raymond.hettinger | 2008-01-22 20:51:41 +0100 (Tue, 22 Jan 2008) | 1 line

  Document when to use izip_longest().
........
  r60202 | georg.brandl | 2008-01-22 20:56:03 +0100 (Tue, 22 Jan 2008) | 2 lines

  Fix for #1087741 patch.
........
  r60203 | raymond.hettinger | 2008-01-22 21:18:53 +0100 (Tue, 22 Jan 2008) | 1 line

  Give zip() the same guarantee as izip() for left-to-right evaluation.
........
  r60204 | raymond.hettinger | 2008-01-22 23:09:26 +0100 (Tue, 22 Jan 2008) | 1 line

  Improve variable name in sample code
........
  r60205 | gregory.p.smith | 2008-01-23 00:15:34 +0100 (Wed, 23 Jan 2008) | 2 lines

  docstring and comment updates suggested by Giampaolo Rodola'
........
  r60207 | raymond.hettinger | 2008-01-23 01:04:40 +0100 (Wed, 23 Jan 2008) | 1 line

  Let pprint() support sets and frozensets (suggested by David Mertz).
........
  r60208 | guido.van.rossum | 2008-01-23 02:18:27 +0100 (Wed, 23 Jan 2008) | 4 lines

  I'm tired of these tests breaking at Google due to our large number of
  users and groups in LDAP/NIS.  So I'm limiting the extra-heavy part of
  the tests to passwd/group files with at most 1000 entries.
........
2008-01-23 08:24:23 +00:00
Guido van Rossum 34d1928766 SF patch# 1770008 by Christian Heimes (plus some extras).
Completely get rid of StringIO.py and cStringIO.c.

I had to fix a few tests and modules beyond what Christian did, and
invent a few conventions.  E.g. in elementtree, I chose to
write/return Unicode strings whe no encoding is given, but bytes when
an explicit encoding is given.  Also mimetools was made to always
assume binary files.
2007-08-09 01:03:29 +00:00
Guido van Rossum 1bc535dc78 Merged revisions 55328-55341 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/p3yk

........
  r55329 | brett.cannon | 2007-05-14 16:36:56 -0700 (Mon, 14 May 2007) | 3 lines

  Implement the removal of tuple parameter unpacking (PEP 3113).
  Thanks, Tony Lownds for the patch.
........
  r55331 | neal.norwitz | 2007-05-14 16:40:30 -0700 (Mon, 14 May 2007) | 1 line

  Update to use Python 3.0
........
  r55332 | brett.cannon | 2007-05-14 16:47:18 -0700 (Mon, 14 May 2007) | 2 lines

  Mention PEP 3113.  And thanks to Tony Lownds for the PEP 3113 patch.
........
  r55333 | neal.norwitz | 2007-05-14 16:57:06 -0700 (Mon, 14 May 2007) | 1 line

  Fix exception printing (no more exceptions module)
........
  r55334 | neal.norwitz | 2007-05-14 17:11:10 -0700 (Mon, 14 May 2007) | 1 line

  Remove popen* functions from os
........
  r55335 | neal.norwitz | 2007-05-14 18:03:38 -0700 (Mon, 14 May 2007) | 1 line

  Get rid of most of popen.  There are still some uses I need to cleanup.
........
  r55336 | neal.norwitz | 2007-05-14 21:11:34 -0700 (Mon, 14 May 2007) | 1 line

  Remove a few more remnants of the compiler package
........
  r55337 | neal.norwitz | 2007-05-14 22:28:27 -0700 (Mon, 14 May 2007) | 1 line

  Get test_[cx]pickle working on 64-bit platforms (avoid overflow int/long)
........
2007-05-15 18:46:22 +00:00
Guido van Rossum 7fe7d1ac4d Don't insist on cStringIO. 2007-05-09 23:42:18 +00:00
Guido van Rossum 07f2436fa8 Nailed test_weakref.py. Pfew, messy! 2007-02-11 22:59:48 +00:00
Guido van Rossum be19ed77dd Fix most trivially-findable print statements.
There's one major and one minor category still unfixed:
doctests are the major category (and I hope to be able to augment the
refactoring tool to refactor bona fide doctests soon);
other code generating print statements in strings is the minor category.

(Oh, and I don't know if the compiler package works.)
2007-02-09 05:37:30 +00:00
Guido van Rossum 47b9ff6ba1 Restructure comparison dramatically. There is no longer a default
*ordering* between objects; there is only a default equality test
(defined by an object being equal to itself only).  Read the comment
in object.c.  The current implementation never uses a three-way
comparison to compute a rich comparison, but it does use a rich
comparison to compute a three-way comparison.  I'm not quite done
ripping out all the calls to PyObject_Compare/Cmp, or replacing
tp_compare implementations with tp_richcompare implementations;
but much of that has happened (to make most unit tests pass).

The following tests still fail, because I need help deciding
or understanding:

test_codeop -- depends on comparing code objects
test_datetime -- need Tim Peters' opinion
test_marshal -- depends on comparing code objects
test_mutants -- need help understanding it

The problem with test_codeop and test_marshal is this: these tests
compare two different code objects and expect them to be equal.
Is that still a feature we'd like to support?  I've temporarily
removed the comparison and hash code from code objects, so they
use the default (equality by pointer only) comparison.

For the other two tests, run them to see for yourself.
(There may be more failing test with "-u all".)

A general problem with getting lots of these tests to pass is
the reality that for object types that have a natural total ordering,
implementing __cmp__ is much more convenient than implementing
__eq__, __ne__, __lt__, and so on.  Should we go back to allowing
__cmp__ to provide a total ordering?  Should we provide some other
way to implement rich comparison with a single method override?
Alex proposed a __key__() method; I've considered a __richcmp__()
method.  Or perhaps __cmp__() just shouldn't be killed off...
2006-08-24 00:41:19 +00:00
Thomas Wouters 4d70c3d9dd Partially merge trunk into p3yk. The removal of Mac/Tools is confusing svn
merge in bad ways, so I'll have to merge that extra-carefully (probably manually.)

Merged revisions 46495-46605 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r46495 | tim.peters | 2006-05-28 03:52:38 +0200 (Sun, 28 May 2006) | 2 lines

  Added missing svn:eol-style property to text files.
........
  r46497 | tim.peters | 2006-05-28 12:41:29 +0200 (Sun, 28 May 2006) | 3 lines

  PyErr_Display(), PyErr_WriteUnraisable():  Coverity found a cut-and-paste
  bug in both:  `className` was referenced before being checked for NULL.
........
  r46499 | fredrik.lundh | 2006-05-28 14:06:46 +0200 (Sun, 28 May 2006) | 5 lines

  needforspeed: added Py_MEMCPY macro (currently tuned for Visual C only),
  and use it for string copy operations.  this gives a 20% speedup on some
  string benchmarks.
........
  r46501 | michael.hudson | 2006-05-28 17:51:40 +0200 (Sun, 28 May 2006) | 26 lines

  Quality control, meet exceptions.c.

  Fix a number of problems with the need for speed code:

  One is doing this sort of thing:

      Py_DECREF(self->field);
      self->field = newval;
      Py_INCREF(self->field);

  without being very sure that self->field doesn't start with a
  value that has a __del__, because that almost certainly can lead
  to segfaults.

  As self->args is constrained to be an exact tuple we may as well
  exploit this fact consistently.  This leads to quite a lot of
  simplification (and, hey, probably better performance).

  Add some error checking in places lacking it.

  Fix some rather strange indentation in the Unicode code.

  Delete some trailing whitespace.

  More to come, I haven't fixed all the reference leaks yet...
........
  r46502 | george.yoshida | 2006-05-28 18:39:09 +0200 (Sun, 28 May 2006) | 3 lines

  Patch #1080727: add "encoding" parameter to doctest.DocFileSuite
  Contributed by Bjorn Tillenius.
........
  r46503 | martin.v.loewis | 2006-05-28 18:57:38 +0200 (Sun, 28 May 2006) | 4 lines

  Rest of patch #1490384: Commit icon source, remove
  claim that Erik von Blokland is the author of the
  installer picture.
........
  r46504 | michael.hudson | 2006-05-28 19:40:29 +0200 (Sun, 28 May 2006) | 16 lines

  Quality control, meet exceptions.c, round two.

  Make some functions that should have been static static.

  Fix a bunch of refleaks by fixing the definition of
  MiddlingExtendsException.

  Remove all the __new__ implementations apart from
  BaseException_new.  Rewrite most code that needs it to cope with
  NULL fields (such code could get excercised anyway, the
  __new__-removal just makes it more likely).  This involved
  editing the code for WindowsError, which I can't test.

  This fixes all the refleaks in at least the start of a regrtest
  -R :: run.
........
  r46505 | marc-andre.lemburg | 2006-05-28 19:46:58 +0200 (Sun, 28 May 2006) | 10 lines

  Initial version of systimes - a module to provide platform dependent
  performance measurements.

  The module is currently just a proof-of-concept implementation, but
  will integrated into pybench once it is stable enough.

  License: pybench license.
  Author: Marc-Andre Lemburg.
........
  r46507 | armin.rigo | 2006-05-28 21:13:17 +0200 (Sun, 28 May 2006) | 15 lines

  ("Forward-port" of r46506)

  Remove various dependencies on dictionary order in the standard library
  tests, and one (clearly an oversight, potentially critical) in the
  standard library itself - base64.py.

  Remaining open issues:
   * test_extcall is an output test, messy to make robust
   * tarfile.py has a potential bug here, but I'm not familiar
     enough with this code.  Filed in as SF bug #1496501.
   * urllib2.HTTPPasswordMgr() returns a random result if there is more
     than one matching root path.  I'm asking python-dev for
     clarification...
........
  r46508 | georg.brandl | 2006-05-28 22:11:45 +0200 (Sun, 28 May 2006) | 4 lines

  The empty string is a valid import path.
   (fixes #1496539)
........
  r46509 | georg.brandl | 2006-05-28 22:23:12 +0200 (Sun, 28 May 2006) | 3 lines

  Patch #1496206: urllib2 PasswordMgr ./. default ports
........
  r46510 | georg.brandl | 2006-05-28 22:57:09 +0200 (Sun, 28 May 2006) | 3 lines

  Fix refleaks in UnicodeError get and set methods.
........
  r46511 | michael.hudson | 2006-05-28 23:19:03 +0200 (Sun, 28 May 2006) | 3 lines

  use the UnicodeError traversal and clearing functions in UnicodeError
  subclasses.
........
  r46512 | thomas.wouters | 2006-05-28 23:32:12 +0200 (Sun, 28 May 2006) | 4 lines


  Make last patch valid C89 so Windows compilers can deal with it.
........
  r46513 | georg.brandl | 2006-05-28 23:42:54 +0200 (Sun, 28 May 2006) | 3 lines

  Fix ref-antileak in _struct.c which eventually lead to deallocating None.
........
  r46514 | georg.brandl | 2006-05-28 23:57:35 +0200 (Sun, 28 May 2006) | 4 lines

  Correct None refcount issue in Mac modules. (Are they
  still used?)
........
  r46515 | armin.rigo | 2006-05-29 00:07:08 +0200 (Mon, 29 May 2006) | 3 lines

  A clearer error message when passing -R to regrtest.py with
  release builds of Python.
........
  r46516 | georg.brandl | 2006-05-29 00:14:04 +0200 (Mon, 29 May 2006) | 3 lines

  Fix C function calling conventions in _sre module.
........
  r46517 | georg.brandl | 2006-05-29 00:34:51 +0200 (Mon, 29 May 2006) | 3 lines

  Convert audioop over to METH_VARARGS.
........
  r46518 | georg.brandl | 2006-05-29 00:38:57 +0200 (Mon, 29 May 2006) | 3 lines

  METH_NOARGS functions do get called with two args.
........
  r46519 | georg.brandl | 2006-05-29 11:46:51 +0200 (Mon, 29 May 2006) | 4 lines

  Fix refleak in socketmodule. Replace bogus Py_BuildValue calls.
  Fix refleak in exceptions.
........
  r46520 | nick.coghlan | 2006-05-29 14:43:05 +0200 (Mon, 29 May 2006) | 7 lines

  Apply modified version of Collin Winter's patch #1478788

  Renames functional extension module to _functools and adds a Python
  functools module so that utility functions like update_wrapper can be
  added easily.
........
  r46522 | georg.brandl | 2006-05-29 15:53:16 +0200 (Mon, 29 May 2006) | 3 lines

  Convert fmmodule to METH_VARARGS.
........
  r46523 | georg.brandl | 2006-05-29 16:13:21 +0200 (Mon, 29 May 2006) | 3 lines

  Fix #1494605.
........
  r46524 | georg.brandl | 2006-05-29 16:28:05 +0200 (Mon, 29 May 2006) | 3 lines

  Handle PyMem_Malloc failure in pystrtod.c. Closes #1494671.
........
  r46525 | georg.brandl | 2006-05-29 16:33:55 +0200 (Mon, 29 May 2006) | 3 lines

  Fix compiler warning.
........
  r46526 | georg.brandl | 2006-05-29 16:39:00 +0200 (Mon, 29 May 2006) | 3 lines

  Fix #1494787 (pyclbr counts whitespace as superclass name)
........
  r46527 | bob.ippolito | 2006-05-29 17:47:29 +0200 (Mon, 29 May 2006) | 1 line

  simplify the struct code a bit (no functional changes)
........
  r46528 | armin.rigo | 2006-05-29 19:59:47 +0200 (Mon, 29 May 2006) | 2 lines

  Silence a warning.
........
  r46529 | georg.brandl | 2006-05-29 21:39:45 +0200 (Mon, 29 May 2006) | 3 lines

  Correct some value converting strangenesses.
........
  r46530 | nick.coghlan | 2006-05-29 22:27:44 +0200 (Mon, 29 May 2006) | 1 line

  When adding a module like functools, it helps to let SVN know about the file.
........
  r46531 | georg.brandl | 2006-05-29 22:52:54 +0200 (Mon, 29 May 2006) | 4 lines

  Patches #1497027 and #972322: try HTTP digest auth first,
  and watch out for handler name collisions.
........
  r46532 | georg.brandl | 2006-05-29 22:57:01 +0200 (Mon, 29 May 2006) | 3 lines

  Add News entry for last commit.
........
  r46533 | georg.brandl | 2006-05-29 23:04:52 +0200 (Mon, 29 May 2006) | 4 lines

  Make use of METH_O and METH_NOARGS where possible.
  Use Py_UnpackTuple instead of PyArg_ParseTuple where possible.
........
  r46534 | georg.brandl | 2006-05-29 23:58:42 +0200 (Mon, 29 May 2006) | 3 lines

  Convert more modules to METH_VARARGS.
........
  r46535 | georg.brandl | 2006-05-30 00:00:30 +0200 (Tue, 30 May 2006) | 3 lines

  Whoops.
........
  r46536 | fredrik.lundh | 2006-05-30 00:42:07 +0200 (Tue, 30 May 2006) | 4 lines

  fixed "abc".count("", 100) == -96 error (hopefully, nobody's relying on
  the current behaviour ;-)
........
  r46537 | bob.ippolito | 2006-05-30 00:55:48 +0200 (Tue, 30 May 2006) | 1 line

  struct: modulo math plus warning on all endian-explicit formats for compatibility with older struct usage (ugly)
........
  r46539 | bob.ippolito | 2006-05-30 02:26:01 +0200 (Tue, 30 May 2006) | 1 line

  Add a length check to aifc to ensure it doesn't write a bogus file
........
  r46540 | tim.peters | 2006-05-30 04:25:25 +0200 (Tue, 30 May 2006) | 10 lines

  deprecated_err():  Stop bizarre warning messages when the tests
  are run in the order:

      test_genexps (or any other doctest-based test)
      test_struct
      test_doctest

  The `warnings` module needs an advertised way to save/restore
  its internal filter list.
........
  r46541 | tim.peters | 2006-05-30 04:26:46 +0200 (Tue, 30 May 2006) | 2 lines

  Whitespace normalization.
........
  r46542 | tim.peters | 2006-05-30 04:30:30 +0200 (Tue, 30 May 2006) | 2 lines

  Set a binary svn:mime-type property on this UTF-8 encoded file.
........
  r46543 | neal.norwitz | 2006-05-30 05:18:50 +0200 (Tue, 30 May 2006) | 1 line

  Simplify further by using AddStringConstant
........
  r46544 | tim.peters | 2006-05-30 06:16:25 +0200 (Tue, 30 May 2006) | 6 lines

  Convert relevant dict internals to Py_ssize_t.

  I don't have a box with nearly enough RAM, or an OS,
  that could get close to tickling this, though (requires
  a dict w/ at least 2**31 entries).
........
  r46545 | neal.norwitz | 2006-05-30 06:19:21 +0200 (Tue, 30 May 2006) | 1 line

  Remove stray | in comment
........
  r46546 | neal.norwitz | 2006-05-30 06:25:05 +0200 (Tue, 30 May 2006) | 1 line

  Use Py_SAFE_DOWNCAST for safety.  Fix format strings.  Remove 2 more stray | in comment
........
  r46547 | neal.norwitz | 2006-05-30 06:43:23 +0200 (Tue, 30 May 2006) | 1 line

  No DOWNCAST is required since sizeof(Py_ssize_t) >= sizeof(int) and Py_ReprEntr returns an int
........
  r46548 | tim.peters | 2006-05-30 07:04:59 +0200 (Tue, 30 May 2006) | 3 lines

  dict_print():  Explicitly narrow the return value
  from a (possibly) wider variable.
........
  r46549 | tim.peters | 2006-05-30 07:23:59 +0200 (Tue, 30 May 2006) | 5 lines

  dict_print():  So that Neal & I don't spend the rest of
  our lives taking turns rewriting code that works ;-),
  get rid of casting illusions by declaring a new variable
  with the obvious type.
........
  r46550 | georg.brandl | 2006-05-30 09:04:55 +0200 (Tue, 30 May 2006) | 3 lines

  Restore exception pickle support. #1497319.
........
  r46551 | georg.brandl | 2006-05-30 09:13:29 +0200 (Tue, 30 May 2006) | 3 lines

  Add a test case for exception pickling. args is never NULL.
........
  r46552 | neal.norwitz | 2006-05-30 09:21:10 +0200 (Tue, 30 May 2006) | 1 line

  Don't fail if the (sub)pkgname already exist.
........
  r46553 | georg.brandl | 2006-05-30 09:34:45 +0200 (Tue, 30 May 2006) | 3 lines

  Disallow keyword args for exceptions.
........
  r46554 | neal.norwitz | 2006-05-30 09:36:54 +0200 (Tue, 30 May 2006) | 5 lines

  I'm impatient.  I think this will fix a few more problems with the buildbots.
  I'm not sure this is the best approach, but I can't think of anything better.
  If this creates problems, feel free to revert, but I think it's safe and
  should make things a little better.
........
  r46555 | georg.brandl | 2006-05-30 10:17:00 +0200 (Tue, 30 May 2006) | 4 lines

  Do the check for no keyword arguments in __init__ so that
  subclasses of Exception can be supplied keyword args
........
  r46556 | georg.brandl | 2006-05-30 10:47:19 +0200 (Tue, 30 May 2006) | 3 lines

  Convert test_exceptions to unittest.
........
  r46557 | andrew.kuchling | 2006-05-30 14:52:01 +0200 (Tue, 30 May 2006) | 1 line

  Add SoC name, and reorganize this section a bit
........
  r46559 | tim.peters | 2006-05-30 17:53:34 +0200 (Tue, 30 May 2006) | 11 lines

  PyLong_FromString():  Continued fraction analysis (explained in
  a new comment) suggests there are almost certainly large input
  integers in all non-binary input bases for which one Python digit
  too few is initally allocated to hold the final result.  Instead
  of assert-failing when that happens, allocate more space.  Alas,
  I estimate it would take a few days to find a specific such case,
  so this isn't backed up by a new test (not to mention that such
  a case may take hours to run, since conversion time is quadratic
  in the number of digits, and preliminary attempts suggested that
  the smallest such inputs contain at least a million digits).
........
  r46560 | fredrik.lundh | 2006-05-30 19:11:48 +0200 (Tue, 30 May 2006) | 3 lines

  changed find/rfind to return -1 for matches outside the source string
........
  r46561 | bob.ippolito | 2006-05-30 19:37:54 +0200 (Tue, 30 May 2006) | 1 line

  Change wrapping terminology to overflow masking
........
  r46562 | fredrik.lundh | 2006-05-30 19:39:58 +0200 (Tue, 30 May 2006) | 3 lines

  changed count to return 0 for slices outside the source string
........
  r46568 | tim.peters | 2006-05-31 01:28:02 +0200 (Wed, 31 May 2006) | 2 lines

  Whitespace normalization.
........
  r46569 | brett.cannon | 2006-05-31 04:19:54 +0200 (Wed, 31 May 2006) | 5 lines

  Clarify wording on default values for strptime(); defaults are used when better
  values cannot be inferred.

  Closes bug #1496315.
........
  r46572 | neal.norwitz | 2006-05-31 09:43:27 +0200 (Wed, 31 May 2006) | 1 line

  Calculate smallest properly (it was off by one) and use proper ssize_t types for Win64
........
  r46573 | neal.norwitz | 2006-05-31 10:01:08 +0200 (Wed, 31 May 2006) | 1 line

  Revert last checkin, it is better to do make distclean
........
  r46574 | neal.norwitz | 2006-05-31 11:02:44 +0200 (Wed, 31 May 2006) | 3 lines

  On 64-bit platforms running test_struct after test_tarfile would fail
  since the deprecation warning wouldn't be raised.
........
  r46575 | thomas.heller | 2006-05-31 13:37:58 +0200 (Wed, 31 May 2006) | 3 lines

  PyTuple_Pack is not available in Python 2.3, but ctypes must stay
  compatible with that.
........
  r46576 | andrew.kuchling | 2006-05-31 15:18:56 +0200 (Wed, 31 May 2006) | 1 line

  'functional' module was renamed to 'functools'
........
  r46577 | kristjan.jonsson | 2006-05-31 15:35:41 +0200 (Wed, 31 May 2006) | 1 line

  Fixup the PCBuild8 project directory.  exceptions.c have moved to Objects, and the functionalmodule.c has been replaced with _functoolsmodule.c.  Other minor changes to .vcproj files and .sln to fix compilation
........
  r46578 | andrew.kuchling | 2006-05-31 16:08:48 +0200 (Wed, 31 May 2006) | 15 lines

  [Bug #1473048]
  SimpleXMLRPCServer and DocXMLRPCServer don't look at
  the path of the HTTP request at all; you can POST or
  GET from / or /RPC2 or /blahblahblah with the same results.
  Security scanners that look for /cgi-bin/phf will therefore report
  lots of vulnerabilities.

  Fix: add a .rpc_paths attribute to the SimpleXMLRPCServer class,
  and report a 404 error if the path isn't on the allowed list.

  Possibly-controversial aspect of this change: the default makes only
  '/' and '/RPC2' legal.  Maybe this will break people's applications
  (though I doubt it).  We could just set the default to an empty tuple,
  which would exactly match the current behaviour.
........
  r46579 | andrew.kuchling | 2006-05-31 16:12:47 +0200 (Wed, 31 May 2006) | 1 line

  Mention SimpleXMLRPCServer change
........
  r46580 | tim.peters | 2006-05-31 16:28:07 +0200 (Wed, 31 May 2006) | 2 lines

  Trimmed trailing whitespace.
........
  r46581 | tim.peters | 2006-05-31 17:33:22 +0200 (Wed, 31 May 2006) | 4 lines

  _range_error():  Speed and simplify (there's no real need for
  loops here).  Assert that size_t is actually big enough, and
  that f->size is at least one.  Wrap a long line.
........
  r46582 | tim.peters | 2006-05-31 17:34:37 +0200 (Wed, 31 May 2006) | 2 lines

  Repaired error in new comment.
........
  r46584 | neal.norwitz | 2006-06-01 07:32:49 +0200 (Thu, 01 Jun 2006) | 4 lines

  Remove ; at end of macro.  There was a compiler recently that warned
  about extra semi-colons.  It may have been the HP C compiler.
  This file will trigger a bunch of those warnings now.
........
  r46585 | georg.brandl | 2006-06-01 08:39:19 +0200 (Thu, 01 Jun 2006) | 3 lines

  Correctly unpickle 2.4 exceptions via __setstate__ (patch #1498571)
........
  r46586 | georg.brandl | 2006-06-01 10:27:32 +0200 (Thu, 01 Jun 2006) | 3 lines

  Correctly allocate complex types with tp_alloc. (bug #1498638)
........
  r46587 | georg.brandl | 2006-06-01 14:30:46 +0200 (Thu, 01 Jun 2006) | 2 lines

  Correctly dispatch Faults in loads (patch #1498627)
........
  r46588 | georg.brandl | 2006-06-01 15:00:49 +0200 (Thu, 01 Jun 2006) | 3 lines

  Some code style tweaks, and remove apply.
........
  r46589 | armin.rigo | 2006-06-01 15:19:12 +0200 (Thu, 01 Jun 2006) | 5 lines

  [ 1497053 ] Let dicts propagate the exceptions in user __eq__().

  [ 1456209 ] dictresize() vulnerability ( <- backport candidate ).
........
  r46590 | tim.peters | 2006-06-01 15:41:46 +0200 (Thu, 01 Jun 2006) | 2 lines

  Whitespace normalization.
........
  r46591 | tim.peters | 2006-06-01 15:49:23 +0200 (Thu, 01 Jun 2006) | 2 lines

  Record bugs 1275608 and 1456209 as being fixed.
........
  r46592 | tim.peters | 2006-06-01 15:56:26 +0200 (Thu, 01 Jun 2006) | 5 lines

  Re-enable a new empty-string test added during the NFS sprint,
  but disabled then because str and unicode strings gave different
  results.  The implementations were repaired later during the
  sprint, but the new test remained disabled.
........
  r46594 | tim.peters | 2006-06-01 17:50:44 +0200 (Thu, 01 Jun 2006) | 7 lines

  Armin committed his patch while I was reviewing it (I'm sure
  he didn't know this), so merged in some changes I made during
  review.  Nothing material apart from changing a new `mask` local
  from int to Py_ssize_t.  Mostly this is repairing comments that
  were made incorrect, and adding new comments.  Also a few
  minor code rewrites for clarity or helpful succinctness.
........
  r46599 | neal.norwitz | 2006-06-02 06:45:53 +0200 (Fri, 02 Jun 2006) | 1 line

  Convert docstrings to comments so regrtest -v prints method names
........
  r46600 | neal.norwitz | 2006-06-02 06:50:49 +0200 (Fri, 02 Jun 2006) | 2 lines

  Fix memory leak found by valgrind.
........
  r46601 | neal.norwitz | 2006-06-02 06:54:52 +0200 (Fri, 02 Jun 2006) | 1 line

  More memory leaks from valgrind
........
  r46602 | neal.norwitz | 2006-06-02 08:23:00 +0200 (Fri, 02 Jun 2006) | 11 lines

  Patch #1357836:

  Prevent an invalid memory read from test_coding in case the done flag is set.
  In that case, the loop isn't entered.  I wonder if rather than setting
  the done flag in the cases before the loop, if they should just exit early.

  This code looks like it should be refactored.

  Backport candidate (also the early break above if decoding_fgets fails)
........
  r46603 | martin.blais | 2006-06-02 15:03:43 +0200 (Fri, 02 Jun 2006) | 1 line

  Fixed struct test to not use unittest.
........
  r46605 | tim.peters | 2006-06-03 01:22:51 +0200 (Sat, 03 Jun 2006) | 10 lines

  pprint functions used to sort a dict (by key) if and only if
  the output required more than one line.  "Small" dicts got
  displayed in seemingly random order (the hash-induced order
  produced by dict.__repr__).  None of this was documented.
  Now pprint functions always sort dicts by key, and the docs
  promise it.

  This was proposed and agreed to during the PyCon 2006 core
  sprint -- I just didn't have time for it before now.
........
2006-06-08 14:42:34 +00:00
Walter Dörwald e62e936e79 Change PrettyPrinter.pprint(), so that output is written directly to the
output stream, instead of writing it to a StringIO first and writing the
result of this to the output stream. This should speed up the initial
output.
2005-11-11 18:18:51 +00:00
Walter Dörwald 1b626cac73 Fix pprint to be able to handle objects that don't have a __repr__
attribute. Fixes SF bug #1065456.
2004-11-15 13:51:41 +00:00
Skip Montanaro 2dc0c13840 typo - fixes 954030. 2004-05-14 16:31:56 +00:00
Walter Dörwald 70a6b49821 Replace backticks with repr() or "%r"
From SF patch #852334.
2004-02-12 17:35:32 +00:00
Walter Dörwald c8de4585a6 Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
and pass them along to the PrettyPrinter constructor.
2003-12-03 20:26:05 +00:00
Walter Dörwald 7a7ede54d4 Patch #750542: pprint now will pretty print subclasses of list, tuple
and dict too, as long as they don't overwrite __repr__().
2003-12-03 20:15:28 +00:00
Martin v. Löwis d02879d620 Revert 1.25, as overloaded __repr__ is not considered. 2003-06-07 20:47:37 +00:00
Martin v. Löwis e57000338f Patch #750542: Use issubclass instead of type identity. 2003-06-07 20:17:11 +00:00
Fred Drake 397b615056 - PrettyPrinter.isreadable(), .isrecursive():
Pass the right number of args to .format().  (Caught by
    pychecker.)
- Protect the global namespace more carefully.
- Don't use the types module now that we don't need to.
2002-12-31 07:14:18 +00:00
Fred Drake e6691efa0f Change the "__ private" names to "_ protected"; this has been a pain for
subclassing so many times it should simply be changed.
2002-07-08 12:28:06 +00:00
Raymond Hettinger 16e3c427f3 Replace boolean test with is None. 2002-06-01 16:07:16 +00:00
Guido van Rossum 8ca162f417 Partial introduction of bools where appropriate. 2002-04-07 06:36:23 +00:00
Fred Drake aee113d368 Add an experimental mechanism to support extending the pprint formatting.
Partly responds to SF bug #505152.
2002-04-02 05:08:35 +00:00
Barry Warsaw 00859c0538 __format(): Applied SF patch #482003 by Skip to fix multiline dict
output.

Patch includes additional test case test_basic_line_wrap().

This patch is a candidate for Python 2.1.2.
2001-11-28 05:49:39 +00:00
Tim Peters 8876848323 Whitespace normalization. 2001-11-13 21:51:26 +00:00
Fred Drake 49cc01e552 Brute-force performance hackery; buys back about 20% of the time for
saferepr(), a bit less for pformat().
2001-11-01 17:50:38 +00:00
Fred Drake 3e5e661150 Remove obsolete email address. 2001-10-09 20:53:48 +00:00
Fred Drake 1ef106c94d Make pprint more locale-friendly; patch contributed by Denis S. Otkidach.
This closes SF patch #451538.
2001-09-04 19:43:26 +00:00
Tim Peters 95b3f78622 pprint's workhorse _safe_repr() function took time quadratic in the # of
elements when crunching a list, dict or tuple.  Now takes linear time
instead -- huge speedup for even moderately large containers, and the
code is notably simpler too.
Added some basic "is the output correct?" tests to test_pprint.
2001-05-14 18:39:41 +00:00
Tim Peters a814db579d SF bug[ #423781: pprint.isrecursive() broken. 2001-05-14 07:05:58 +00:00
Skip Montanaro c62c81e013 __all__ for several more modules 2001-02-12 02:00:42 +00:00
Thomas Wouters 7e47402264 Spelling fixes supplied by Rob W. W. Hooft. All these are fixes in either
comments, docstrings or error messages. I fixed two minor things in
test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't").

There is a minor style issue involved: Guido seems to have preferred English
grammar (behaviour, honour) in a couple places. This patch changes that to
American, which is the more prominent style in the source. I prefer English
myself, so if English is preferred, I'd be happy to supply a patch myself ;)
2000-07-16 12:04:32 +00:00
Fred Drake fbff97a73b Don't call len() if the value is already cached! Caught by Gerrit
Holl <gerrit.holl@pobox.com>.
1999-12-22 21:52:32 +00:00
Guido van Rossum 183fd40987 Fix indent error in __format(): del context[objid] at the end should
be executed in all cases, not just when it's not a list, tuple or
dict.  Discovered by Christian Tismer.
1999-09-02 15:09:44 +00:00
Fred Drake d804f4eea0 _safe_repr(): Simplify the condition tests in the first possible
return path.
1999-02-17 17:30:52 +00:00
Guido van Rossum 45e2fbc2e7 Mass check-in after untabifying all files that need it. 1998-03-26 21:13:24 +00:00
Guido van Rossum a1dbe50ec2 Added code to emit trailing ',' for singleton tuples in two places. 1997-09-14 23:21:51 +00:00
Fred Drake e0ffabe375 Slight mods to make the module conform to the documentation. 1997-07-18 20:42:39 +00:00
Fred Drake 5fd026dc5e Fix a couple of glitches identified by Greg Stein. 1997-04-18 13:54:13 +00:00