Commit Graph

26440 Commits

Author SHA1 Message Date
Guido van Rossum f631859409 Add __getnewargs__ method to classes that need it.
(Yes, this is an incompatibility.  I'll document it in PEP 307.)
2003-02-07 14:59:13 +00:00
Fred Drake 693aea2eb4 - make some links into the reference documentation relative for
off-line readers
- fix some minor typos and markup errors
2003-02-07 14:52:18 +00:00
Raymond Hettinger f0c00241ae * Eliminated tuple re-use in imap(). Doing it correctly made the code
too hard to read.
* Simplified previous changes to izip() to make it easier to read.
2003-02-07 07:26:25 +00:00
Raymond Hettinger 2012f174ea SF bug #681003: itertools issues
* Fixed typo in exception message for times()
* Filled in missing times_traverse()
* Document reasons that imap() did not adopt a None fill-in feature
* Document that count(sys.maxint) will wrap-around on overflow
* Add overflow test to islice()
* Check that starmap()'s argument returns a tuple
* Verify that imap()'s tuple re-use is safe
* Make a similar tuple re-use (with safety check) for izip()
2003-02-07 05:32:58 +00:00
Neal Norwitz 2b09bc4d57 Fix SF bug #675259, os.environ leaks under FreeBSD and Mac OS X
Even with the extra work to cleanup the env, *BSD still leaks.  Add a note.

Will backport.
2003-02-07 02:27:36 +00:00
Fred Drake dab8b0ad99 Integrate the patch from expat.h 1.51; needed for some C compilers.
Closes SF bug #680797.
2003-02-07 02:15:56 +00:00
Tim Peters 550e4e5583 SF bug 666444: 'help' makes linefeed only under Win32.
Reverting one of those irritating "security fixes".  fdopen() opens
files in binary mode.  That makes pydoc skip the \r\n on Windows that's
need to make the output readable in the shell.  Screw it.
2003-02-07 01:53:46 +00:00
Jack Jansen 658375b833 Got rid of macfs. 2003-02-06 23:13:11 +00:00
Jack Jansen caaad98ebd Got rid of macfs and FSSpecs. 2003-02-06 23:12:23 +00:00
Jack Jansen c929636bc2 Added a note about getting rid of macfs usage (MacPython). 2003-02-06 23:10:45 +00:00
Jack Jansen 5a79329547 Got rid of FSSpecs. 2003-02-06 22:57:44 +00:00
Guido van Rossum 5aac4e6312 Move _better_reduce from copy.py to copy_reg.py, and also use it in
pickle.py, where it makes save_newobj() unnecessary.  Tests pass.
2003-02-06 22:57:00 +00:00
Jack Jansen e7ee17c58e Got rid of macfs and FSSpecs in general (pathnames or FSRefs are now
used everywhere).
2003-02-06 22:32:35 +00:00
Guido van Rossum 85233bf746 Fix a bug in the way __getnewargs__ was handled. 2003-02-06 21:25:12 +00:00
Neal Norwitz 694d9b3541 Update doc to reflect code changes for obsoleting use_statcache parameter 2003-02-06 21:17:17 +00:00
Andrew M. Kuchling d683504b85 Use new name for GetoptError, and pass it two arguments
Use re module instead of regex
2003-02-06 19:55:35 +00:00
Guido van Rossum c755758906 Support all the new stuff supported by the new pickle code:
- subclasses of list or dict
- __reduce__ returning a 4-tuple or 5-tuple
- slots
2003-02-06 19:53:22 +00:00
Andrew M. Kuchling 0189266456 A few naughty external scripts do 'raise getopt.error, "blah"', and
now crash because two arguments are expected.  Add a default value
   to keep those scripts running.
2003-02-06 19:52:56 +00:00
Andrew M. Kuchling 83e879d99f Add DeprecationWarning when use_statcache argument is supplied
Fix use of GetoptError, so demo() now works
2003-02-06 19:38:45 +00:00
Guido van Rossum 98b922c0ec Remove a debug print statement. 2003-02-06 19:30:38 +00:00
Michael W. Hudson 241c2e9692 Remove another lie. 2003-02-06 18:38:11 +00:00
Michael W. Hudson 847f37543f Correct lie about METH_NOARGS functions.
Backport candidate.
2003-02-06 18:37:11 +00:00
Guido van Rossum 90e05b0e25 Support __reduce__ returning a 4-tuple or 5-tuple. 2003-02-06 18:18:23 +00:00
Andrew M. Kuchling 93cf58b015 Typo fixes 2003-02-06 18:04:43 +00:00
Guido van Rossum 581cb938d0 A test suite for the copy module. This should provide full code
coverage.
2003-02-06 17:52:15 +00:00
Andrew M. Kuchling 8eb4044f7e [Bug #680494] filecmp.py uses obsolete statcache module.
Simply replace all uses of statcache with os.stat.

Should I add a DeprecationWarning triggered if the use_statcache argument
is supplied, so we can remove it in 2.4?
2003-02-06 17:50:01 +00:00
Andrew M. Kuchling e63846dc3a Add test suite for filecmp.py, after some discussion on bug #680494.
Right now the test cases create a files and a directory in the temp.
directory.  Raymond suggested checking files in to the test/ directory,
simplifying the setup/teardown methods; is that worth doing?
2003-02-06 17:42:45 +00:00
Tim Peters 844076122e SF bug 680864: test_datetime fails for non-unix epoch
Apparently MAC OS 9 doesn't have POSIX-conforming timestamps.  A test
fails as a result, but at least for this specific test it's easy enough
to get the POSIX epoch out of it.
2003-02-06 16:42:14 +00:00
Jeremy Hylton cc1fccbc1c No need for a continuation line. 2003-02-06 16:23:01 +00:00
Jeremy Hylton 656d4519b5 Replace hasattr() + getattr() with single getattr() and default value. 2003-02-06 16:22:01 +00:00
Guido van Rossum 26507dbc82 Clarify that __module__ applies to various type of functions. 2003-02-06 16:16:50 +00:00
Jeremy Hylton 0253d6eff1 Add news item about __module__ attribute on functions. 2003-02-06 16:00:15 +00:00
Andrew M. Kuchling c9172d3832 Comment typo fix 2003-02-06 15:22:49 +00:00
Andrew M. Kuchling 80fd7851ac Mention FutureWarning for large ints 2003-02-06 15:14:04 +00:00
Andrew M. Kuchling ba37524b7c Fix description of filterwarnings() parameters (error noted by Richard Jones at
http://mechanicalcat.net/cgi-bin/log/python/turning_warnings_off.html)
2003-02-06 14:38:45 +00:00
Neal Norwitz 292f56cd26 Provide version changed info 2003-02-06 05:02:39 +00:00
Anthony Baxter 983b008824 Updated version of [ 558544 ] cmd.py: add instance-specific stdin/out
This patch adds stdin, stdout as optional arguments to the cmd.Cmd
constructor (defaulting to sys.stdin, sys.stdout), and changes the Cmd
methods throughout to use self.stdout.write() and self.stdin.foo for
output and input. This allows much greater flexibility for using cmd -
for instance, hooking it into a telnet server.

Patch for library module and for documentation.
2003-02-06 01:45:11 +00:00
Jeremy Hylton 985eba53f5 Small function call optimization and special build option for call stats.
-DCALL_PROFILE: Count the number of function calls executed.

When this symbol is defined, the ceval mainloop and helper functions
count the number of function calls made.  It keeps detailed statistics
about what kind of object was called and whether the call hit any of
the special fast paths in the code.

Optimization:

When we take the fast_function() path, which seems to be taken for
most function calls, and there is minimal frame setup to do, avoid
call PyEval_EvalCodeEx().  The eval code ex function does a lot of
work to handle keywords args and star args, free variables,
generators, etc.  The inlined version simply allocates the frame and
copies the arguments values into the frame.

The optimization gets a little help from compile.c which adds a
CO_NOFREE flag to code objects that don't have free variables or cell
variables.  This change allows fast_function() to get into the fast
path with fewer tests.

I measure a couple of percent speedup in pystone with this change, but
there's surely more that can be done.
2003-02-05 23:13:00 +00:00
Jack Jansen f3f4af5521 Got rid of macfs and made a bit more OSX-friendly. 2003-02-05 23:10:46 +00:00
Just van Rossum 19e02fc67f removing old junk 2003-02-05 22:59:07 +00:00
Jack Jansen ab564eea05 Removed unused import of macfs. 2003-02-05 22:53:29 +00:00
Jack Jansen 6d8bca8cb6 I don't think this script serves a useful purpose anymore, and I can't
be bothered to fix it.
2003-02-05 22:52:16 +00:00
Guido van Rossum ce8bcd8405 Fix for SF #668433. I'm not explaining it here; ample comments are in
the code.
2003-02-05 22:39:45 +00:00
Jeremy Hylton bd5cbf866f Refactor the logic for setting f_builtins.
For the case where the current globals match the previous frame's
globals, eliminates three tests in two if statements.  For the case
where we just get __builtins__ from a module, eliminate a couple of
tests.
2003-02-05 22:39:29 +00:00
Andrew M. Kuchling 64edd6ac1d [Patch #654421 from Matthew Mueller]
gzip shouldn't raise ValueError on corrupt files

  Currently the gzip module will raise a ValueError if the file was
  corrupt (bad crc or bad size).  I can't see how that applies to
  reading a corrupt file.  IOError seems better, and it's what code
  will likely be looking for.
2003-02-05 21:35:07 +00:00
Andrew M. Kuchling 570e35870a Markup fixes; in particular, the tables are now reasonable width 2003-02-05 21:15:38 +00:00
Tim Peters 62235e701e dis(): Added an optional memo argument, so that multiple pickles in a
file can be dumped without (bogus) complaint if the the pickles were
created using a single pickle memo.
2003-02-05 19:55:53 +00:00
Tim Peters 18e7083cda SF bug 681122: Built-in function dir() causes refcount leak in baseclasses.
merge_class_dict():  This was missing a decref.

Bugfix candidate.
2003-02-05 19:35:19 +00:00
Tim Peters 6ee0480521 [680789] Debug with long array takes forever
Added array.array to the types repr.py knows about, after a suggestion
from Jurjen N.E. Bos.
2003-02-05 18:29:34 +00:00
Jason Tishler 5c4ded2c3b Patch #551977: Regression exceptions for cygwin
Applied the skip test_ossaudiodev patch.
2003-02-05 16:46:01 +00:00