Commit Graph

1389 Commits

Author SHA1 Message Date
Just van Rossum 46c9784f68 Patch #683592: unicode support for os.listdir()
os.listdir() may now return unicode strings on platforms that set
Py_FileSystemDefaultEncoding.
2003-02-25 21:42:15 +00:00
Skip Montanaro 12fe72e9df note the demise of the dospath module (was actually in 2.3a2) 2003-02-25 17:46:20 +00:00
Guido van Rossum 0f69833396 2.3b1 patches 2003-02-24 17:55:37 +00:00
Jack Jansen deac2acdb8 Added a note about MacOS.WMAvailable(). 2003-02-24 11:04:17 +00:00
Guido van Rossum 902a671c7b Deleting the 2.2 spec. 2003-02-24 01:12:54 +00:00
Guido van Rossum 2ef777fd82 RPM spec file for 2.3a2, contributed by Sean Reifschneider. 2003-02-24 01:09:53 +00:00
Neal Norwitz 35892b9ad9 Fix SF bug #691793, Python 2.3a2 build fails on Tru64 2003-02-23 23:45:35 +00:00
Neal Norwitz d5a65a77cf Fix SF bug #689659, 64-bit int and long hash keys incompatible
On a 64-bit machine, a dictionary could contain duplicate int/long keys
if the value was > 2**32.
2003-02-23 23:11:41 +00:00
Raymond Hettinger 61fe64d5de User requested changes to the itertools module.
Subsumed times() into repeat().
Added cycle() and chain().
2003-02-23 04:40:07 +00:00
Guido van Rossum 351a7dd64a Prepped for 2.3b1.
Added an extra blank line before "What's New in Python 2.2 final?".
2003-02-20 01:56:17 +00:00
Guido van Rossum 16c8517988 Match parentheses. 2003-02-20 01:52:48 +00:00
Guido van Rossum a003290da5 Merge in changes made to the 2.3a2 release. 2003-02-20 01:38:31 +00:00
David Goodger dd83cce8ea fixed markup 2003-02-19 23:31:51 +00:00
Guido van Rossum 22e2f73d91 Update versions/dates for release of 2.3a2. Added some last-minute news. 2003-02-19 18:18:47 +00:00
Walter Dörwald 2ffec02b48 Add a note about the recent PEP 293 changes. 2003-02-19 16:34:11 +00:00
Guido van Rossum 6297a7a9fb - PyEval_GetFrame() is now declared to return a PyFrameObject *
instead of a plain PyObject *.  (SF patch #686601 by Ben Laurie.)
2003-02-19 15:53:17 +00:00
Guido van Rossum 162e38c6a3 - sys.path[0] (the directory from which the script is loaded) is now
turned into an absolute pathname, unless it is the empty string.
  (SF patch #664376, by Skip Montanaro.)
2003-02-19 15:25:10 +00:00
Jack Jansen 5d44b347c9 Added a note that MacOSX applets can no longer be run from a terminal window. 2003-02-18 23:32:47 +00:00
Guido van Rossum 6921eca227 Make PyNumber_Check() a bit more careful, since all sorts of things
now have tp_as_number.  Check for nb_int or nb_float.
2003-02-18 16:36:28 +00:00
Michael W. Hudson 9e5d87fa20 Reword section about moving variables to os.path to match intent (or
at least, what I thought the intent was).
2003-02-17 12:26:23 +00:00
Andrew MacIntyre 251b816297 Patch 686397:
move definition of platform dependent path related variables from os.py
to platform dependent path modules (ntpath, etc).
2003-02-17 09:20:23 +00:00
Jack Jansen 9f70aabbf8 Added notes about pimp and bundlebuilder to the Mac section. 2003-02-16 23:00:53 +00:00
Guido van Rossum 4507ec70cf - The audio driver tests (test_ossaudiodev.py and
test_linuxaudiodev.py) are no longer run by default.  This is
  because they don't always work, depending on your hardware and
  software.  To run these tests, you must use an invocation like
    ./python Lib/test/regrtest.py -u audio test_ossaudiodev
2003-02-14 19:29:22 +00:00
Guido van Rossum 1442dc1194 Add SF reference to news item. 2003-02-13 22:19:20 +00:00
Guido van Rossum 4b499dd3fb - Finally fixed the bug in compile() and exec where a string ending
with an indented code block but no newline would raise SyntaxError.
  This would have been a four-line change in parsetok.c...  Except
  codeop.py depends on this behavior, so a compilation flag had to be
  invented that causes the tokenizer to revert to the old behavior;
  this required extra changes to 2 .h files, 2 .c files, and 2 .py
  files.  (Fixes SF bug #501622.)
2003-02-13 22:07:59 +00:00
Guido van Rossum 298e421453 SF patch #685738 by Michael Stone.
This changes the default __new__ to refuse arguments iff tp_init is the
default __init__ implementation -- thus making it a TypeError when you
try to pass arguments to a constructor if the class doesn't override at
least __init__ or __new__.
2003-02-13 16:30:16 +00:00
Guido van Rossum c4f4ca91e1 Provide access to the import lock, fixing SF bug #580952. This is
mostly from SF patch #683257, but I had to change unlock_import() to
return an error value to avoid fatal error.

Should this be backported?  The patch requested this, but it's a new
feature.
2003-02-12 21:46:11 +00:00
Guido van Rossum 47710656e5 Issue a warning when int('0...', 0) returns an int with the sign
folded; this will change in Python 2.4.  On a 32-bit machine, this
happens for 0x80000000 through 0xffffffff, and for octal constants in
the same value range.  No warning is issued if an explicit base is
given, *or* if the string contains a sign (since in those cases no
sign folding ever happens).
2003-02-12 20:48:22 +00:00
Guido van Rossum 48035eb452 SF #660455 : patch by NNorwitz.
"Unsigned" (i.e., positive-looking, but really negative) hex/oct
constants with a leading minus sign are once again properly negated.
The micro-optimization for negated numeric constants did the wrong
thing for such hex/oct constants.  The patch avoids the optimization
for all hex/oct constants.

This needs to be backported to Python 2.2!
2003-02-12 17:05:26 +00:00
Guido van Rossum a89d10edc9 Implement another useful feature for proxies: in super(X, x), x may
now be a proxy for an X instance, as long as issubclass(x.__class__, X).
2003-02-12 03:58:38 +00:00
Guido van Rossum 03bc7d3c4d SF #532767: isinstance(x, X) should work when x is a proxy for an X
instance, as long as x.__class__ is X or a subclass thereof.
Did a little cleanup of PyObject_IsInstance() too.
2003-02-12 03:32:58 +00:00
Guido van Rossum eea4718e81 Fix from SF #681367: inherit tp_as_buffer. This only applies to C
types -- Python types already inherited this.
2003-02-11 20:39:59 +00:00
Just van Rossum e1ebd80b04 mention unicode file name support on OSX 2003-02-10 10:06:18 +00:00
Just van Rossum 73ffb4aa4e mention unicode support in compile, eval and exec 2003-02-10 09:57:08 +00:00
Neal Norwitz de8b94c3e1 Fix SF bug #683467, 'int' ability to generate longs not inherited
When subclassing from an int but not overriding __new__,
long values were not converted properly.  Try to convert
longs into an int.
2003-02-10 02:12:43 +00:00
Neal Norwitz 9caf9c040e Add tests and news entry about parser errors from bug #678518. 2003-02-10 01:54:06 +00:00
Neal Norwitz 573e033488 Alphabetize some names
Add Grant Olson for patch provided to fix bug #678518
2003-02-10 01:09:49 +00:00
Tim Peters 07534a607b Comparison for timedelta, time, date and datetime objects: __eq__ and
__ne__ no longer complain if they don't know how to compare to the other
thing.  If no meaningful way to compare is known, saying "not equal" is
sensible.  This allows things like

    if adatetime in some_sequence:
and
    somedict[adatetime] = whatever

to work as expected even if some_sequence contains non-datetime objects,
or somedict non-datetime keys, because they only call __eq__.

It still complains (raises TypeError) for mixed-type comparisons in
contexts that require a total ordering, such as list.sort(), use as a
key in a BTree-based data structure, and cmp().
2003-02-07 22:50:28 +00:00
Jack Jansen c929636bc2 Added a note about getting rid of macfs usage (MacPython). 2003-02-06 23:10:45 +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
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
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
Neil Schemenauer 5042da6b1e If a float is passed where a int is expected, issue a DeprecationWarning
instead of raising a TypeError.  Closes #660144 (again).
2003-02-04 20:59:40 +00:00
Walter Dörwald 28d81966c9 Fix typo. 2003-02-03 20:53:14 +00:00
Guido van Rossum 7d9ea5013f - Thanks to Scott David Daniels, a subtle bug in how the zlib
extension implemented flush() was fixed.  Scott also rewrite the
  zlib test suite using the unittest module.  (SF bug #640230 and
  patch #678531.)

Backport candidate I think.
2003-02-03 20:45:52 +00:00
Skip Montanaro 621f055233 braino 2003-02-03 15:48:10 +00:00
Skip Montanaro 13b291021f add note about new db2pickle.py and pickle2db.py scripts 2003-02-03 15:17:25 +00:00
Neal Norwitz 6c54ef6884 Add some notes that got python to work on the snake farm 2003-02-02 17:10:04 +00:00
Tim Peters bf2674be0e long(string, base) now takes time linear in len(string) when base is a
power of 2.  Enabled the tail end of test_long() in pickletester.py
because it no longer takes forever when run from test_pickle.py.
2003-02-02 07:51:32 +00:00