Commit Graph

311 Commits

Author SHA1 Message Date
Martin v. Löwis 16dc7f44b1 Patch #462190, patch #464070: Support quoted printable in the binascii module.
Decode and encode underscores for header style encoding. Fixes bug #463996.
2001-09-30 20:32:11 +00:00
Tim Peters d38b1c74f3 SF [#466125] PyLong_AsLongLong works for any integer.
Generalize PyLong_AsLongLong to accept int arguments too.  The real point
is so that PyArg_ParseTuple's 'L' code does too.  That code was
undocumented (AFAICT), so documented it.
2001-09-30 05:09:37 +00:00
Tim Peters abf925f6bf Post-release fiddling (prep for 2.2b1). 2001-09-28 21:53:42 +00:00
Barry Warsaw 647d5e8f4a Fixed a minor typo. 2001-09-28 17:01:02 +00:00
Barry Warsaw 86fbaf8e67 Merged changes from 22a4 branch. 2001-09-28 15:26:12 +00:00
Marc-André Lemburg bf99017bbb Added note about new StringIO/cStringIO feature. 2001-09-27 14:17:33 +00:00
Guido van Rossum 808eea70ec Separate out the type/class-related news and reword some items.
Add news items about comparisons, repr(), __class__ assignment.
2001-09-25 04:15:41 +00:00
Tim Peters 66c1a525e0 Make properties discoverable from Python:
- property() now takes 4 keyword arguments:  fget, fset, fdel, doc.
  Note that the real purpose of the 'f' prefix is to make fdel fit in
  ('del' is a keyword, so can't used as a keyword argument name).

- These map to visible readonly attributes 'fget', 'fset', 'fdel',
  and '__doc__' in the property object.

- fget/fset/fdel weren't discoverable from Python before.

- __doc__ is new, and allows to associate a docstring with a property.
2001-09-24 21:17:50 +00:00
Barry Warsaw 2f60073d2d Added a note about the new email package. 2001-09-24 04:28:10 +00:00
Tim Peters 2c9aa5ea8d Generalize file.writelines() to allow iterable objects. 2001-09-23 04:06:05 +00:00
Tim Peters 8a9c284437 Make difflib.ndiff() and difflib.Differ.compare() generators. This
restores the 2.1 ability of Tools/scripts/ndiff.py to start producing
output before the entire comparison is complete.
2001-09-22 21:30:22 +00:00
Guido van Rossum 380bad1b4e Add note about __getattribute__. 2001-09-22 17:10:44 +00:00
Barry Warsaw 58b072d53f {String,cString}IO.StringIO's support iteration. 2001-09-22 04:44:21 +00:00
Marc-André Lemburg aefd766eed Note about enhancements to unicode(). 2001-09-20 12:59:37 +00:00
Guido van Rossum c9ed5dc81c News about compiler and pydoc. 2001-09-20 05:30:24 +00:00
Martin v. Löwis 2777c021fc Patch #462849: Pass Unicode objects to file's .write method. 2001-09-19 13:47:32 +00:00
Marc-André Lemburg 494f2aea8e Docs and News item for the codecs.py additions. 2001-09-19 11:33:31 +00:00
Guido van Rossum 624c8af706 All the news that fits, we print.
(Went through the logs looking for nuggets.  This is what I found.)
2001-09-18 15:21:04 +00:00
Guido van Rossum d8185ca43e Mention SMTP additions and hmac module. 2001-09-14 16:35:16 +00:00
Tim Peters 59c9a645e2 SF bug [#460467] file objects should be subclassable.
Preliminary support.  What's here works, but needs fine-tuning.
2001-09-13 05:38:56 +00:00
Tim Peters 1f47d11ff2 Added items about significant subclass bugfixes. 2001-09-12 23:40:29 +00:00
Tim Peters 9a9471ca1c Add info about Windows filesystem limits. 2001-09-11 23:18:51 +00:00
Tim Peters 16a77adfbd Generalize operator.indexOf (PySequence_Index) to work with any
iterable object.  I'm not sure how that got overlooked before!

Got rid of the internal _PySequence_IterContains, introduced a new
internal _PySequence_IterSearch, and rewrote all the iteration-based
"count of", "index of", and "is the object in it or not?" routines to
just call the new function.  I suppose it's slower this way, but the
code duplication was getting depressing.
2001-09-08 04:00:12 +00:00
Tim Peters b07352e8b7 The usual post-release fiddling. 2001-09-08 01:25:47 +00:00
Barry Warsaw d6c8ca6536 Merging 2.2a3 branch changes back into trunk 2001-09-07 18:13:44 +00:00
Guido van Rossum 8d7234d1dc Rename 'getset' to 'property'. 2001-09-06 22:02:58 +00:00
Steve Purcell 6091cd61ce Added note of unittest.py changes that fixed bug 451309 2001-09-06 16:05:17 +00:00
Martin v. Löwis cb227c9850 Report patch #416079 changes. 2001-09-06 08:54:16 +00:00
Tim Peters 6e13a562ae Enable large file support on Win32 systems.
Curious:  the MS docs say stati64 etc are supported even on Win95, but
Win95 doesn't support a filesystem that allows partitions > 2 Gb.

test_largefile:  This was opening its test file in text mode.  I have no
idea how that worked under Win64, but it sure needs binary mode on Win98.
BTW, on Win98 test_largefile runs quickly (under a second).
2001-09-06 00:32:15 +00:00
Tim Peters a40c793d06 Rework the way we try to check for libm overflow, given that C99 no longer
requires that errno ever get set, and it looks like glibc is already
playing that game.  New rules:

+ Never use HUGE_VAL.  Use the new Py_HUGE_VAL instead.

+ Never believe errno.  If overflow is the only thing you're interested in,
  use the new Py_OVERFLOWED(x) macro.  If you're interested in any libm
  errors, use the new Py_SET_ERANGE_IF_OVERFLOW(x) macro, which attempts
  to set errno the way C89 said it worked.

Unfortunately, none of these are reliable, but they work on Windows and I
*expect* under glibc too.
2001-09-05 22:36:56 +00:00
Guido van Rossum 32aa5d2c0b Describe -E (which was added to 2.2a2). 2001-09-05 18:43:35 +00:00
Martin v. Löwis 44f8696171 Patch #428326: New class threading.Timer. 2001-09-05 13:44:54 +00:00
Tim Peters 785261684e Return reasonable results for math.log(long) and math.log10(long) (we were
getting Infs, NaNs, or nonsense in 2.1 and before; in yesterday's CVS we
were getting OverflowError; but these functions always make good sense
for positive arguments, no matter how large).
2001-09-05 00:53:45 +00:00
Tim Peters 7eea37e831 At Guido's suggestion, here's a new C API function, PyObject_Dir(), like
__builtin__.dir().  Moved the guts from bltinmodule.c to object.c.
2001-09-04 22:08:56 +00:00
Tim Peters 9fffa3eea3 Raise OverflowError when appropriate on long->float conversion. Most of
the fiddling is simply due to that no caller of PyLong_AsDouble ever
checked for failure (so that's fixing old bugs).  PyLong_AsDouble is much
faster for big inputs now too, but that's more of a happy consequence
than a design goal.
2001-09-04 05:14:19 +00:00
Guido van Rossum 61c345fa37 Rename the -D option to -Q, to avoid a Jython option name conflict. 2001-09-04 03:26:15 +00:00
Tim Peters 32f453eaa4 New restriction on pow(x, y, z): If z is not None, x and y must be of
integer types, and y must be >= 0.  See discussion at
http://sf.net/tracker/index.php?func=detail&aid=457066&group_id=5470&atid=105470
2001-09-03 08:35:41 +00:00
Tim Peters 5d2b77cf31 Make dir() wordier (see the new docstring). The new behavior is a mixed
bag.  It's clearly wrong for classic classes, at heart because a classic
class doesn't have a __class__ attribute, and I'm unclear on whether
that's feature or bug.  I'll repair this once I find out (in the
meantime, dir() applied to classic classes won't find the base classes,
while dir() applied to a classic-class instance *will* find the base
classes but not *their* base classes).

Please give the new dir() a try and see whether you love it or hate it.
The new dir([]) behavior is something I could come to love.  Here's
something to hate:

>>> class C:
...     pass
...
>>> c = C()
>>> dir(c)
['__doc__', '__module__']
>>>

The idea that an instance has a __doc__ attribute is jarring (of course
it's really c.__class__.__doc__ == C.__doc__; likewise for __module__).

OTOH, the code already has too many special cases, and dir(x) doesn't
have a compelling or clear purpose when x isn't a module.
2001-09-03 05:47:38 +00:00
Tim Peters b7da09099a Clarify the Borland situation, based on email from Stephen. 2001-09-02 23:01:43 +00:00
Guido van Rossum aaf80c8c87 Add news about dictionary() constructor. 2001-09-02 13:44:35 +00:00
Tim Peters bdee63fff3 Start items w/ "-" instead of "+" (consistency w/ earlier versions).
Stephen Hansen reported via email that he didn't finish the port to
Borland C, so remove the old item saying it worked and add a new item
saying what I know; I've asked Stephen for more details.
2001-09-02 03:40:59 +00:00
Guido van Rossum ae45714ed3 Add various and sundry news items -- most mine, one Barry's, one
Michael Hudson's.
2001-08-31 18:31:35 +00:00
Tim Peters d507dab91f SF patch #455966: Allow leading 0 in float/imag literals.
Consequences for Jython still unknown (but raised on Jython-Dev).
2001-08-30 20:51:59 +00:00
Neil Schemenauer 4042c69b5e Add news about GC API change. Explain how to upgrade extension modules. 2001-08-30 15:38:01 +00:00
Tim Peters 692323488b Add a new function imp.lock_held(), and use it to skip test_threaded_import
when that test is doomed to deadlock.
2001-08-30 05:16:13 +00:00
Tim Peters 8211237db8 marshal.c r_long64: When reading a TYPE_INT64 value on a box with 32-bit
ints, convert to PyLong (rather than throwing away the high-order 32 bits).
2001-08-29 02:28:42 +00:00
Tim Peters c6d958192e Note change in fp literal syntax (e.g. "3e-" worked by accident before). 2001-08-28 20:56:27 +00:00
Tim Peters 402d5985d8 SF patch [ #455137 ] Makes popen work with COMMAND.COM on WNT, from
Brian Quinlan.
2001-08-27 06:37:48 +00:00
Tim Peters edc9931f56 "The usual" post-release fiddling. 2001-08-22 21:36:50 +00:00
Barry Warsaw 18b2ecfa9a Add an item about Tim's new installer. This didn't make it into the
2.2a2 release, but it's still worth mentioning.
2001-08-22 20:26:56 +00:00
Barry Warsaw 6f3410deaa More NEWS for 2.2a2. 2001-08-22 04:08:41 +00:00
Jack Jansen 32ce0cdd30 Added a note about --enable-framework on Mac OS X. 2001-08-21 19:28:20 +00:00
Tim Peters 6cd6a82db9 A fiddled version of the rest of Michael Hudson's SF patch
#449043 supporting __future__ in simulated shells
which implements PEP 264.
2001-08-17 22:11:27 +00:00
Guido van Rossum f86ddd2971 Add note on type/class unification. 2001-08-17 21:21:04 +00:00
Martin v. Löwis 339d0f720e Patch #445762: Support --disable-unicode
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
- check for Py_USING_UNICODE in all places that use Unicode functions
- disables unicode literals, and the builtin functions
- add the types.StringTypes list
- remove Unicode literals from most tests.
2001-08-17 18:39:25 +00:00
Martin v. Löwis e3eb1f2b23 Patch #427190: Implement and use METH_NOARGS and METH_O. 2001-08-16 13:15:00 +00:00
Andrew M. Kuchling b053209af7 Fix typo 2001-08-15 15:54:56 +00:00
Tim Peters 0afb60951d Add blurb about cleanfuture.py. Fix misspelling in an older item. 2001-08-15 06:06:44 +00:00
Barry Warsaw 9b3be7f5d9 Document the new semantics for setting and deleting a function's
__dict__ attribute.  Deleting it, or setting it to a non-dictionary
result in a TypeError.  Note that getting it the first time magically
initializes it to an empty dict so that func.__dict__ will always
appear to be a dictionary (never None).

Closes SF bug #446645.
2001-08-14 18:35:02 +00:00
Tim Peters 5e824c37d3 SF patch #445412 extract ndiff functionality to difflib, from
David Goodger.
2001-08-12 22:25:01 +00:00
Tim Peters c173137391 Derived from SF patch #446899 Permit import of .pyw under Windows, from
David Bolen.
2001-08-04 08:12:36 +00:00
Tim Peters 6d6c1a35e0 Merge of descr-branch back into trunk. 2001-08-02 04:15:00 +00:00
Marc-André Lemburg d627791cf1 Moved the news items about C API topics down to the C API section. 2001-07-31 14:42:42 +00:00
Marc-André Lemburg 48dbfe9aa2 Add news item about Unicode API name mangling. 2001-07-31 14:37:40 +00:00
Marc-André Lemburg 888fac020c Add news items. 2001-07-31 14:24:31 +00:00
Martin v. Löwis 66b6e192b9 Patch #416224: add readline completion to cmd.Cmd. 2001-07-28 14:44:03 +00:00
Fred Drake b7cea6324a Add item about the new xml.sax.saxutils.quoteaddr() function. 2001-07-21 12:25:10 +00:00
Tim Peters 20f51a7b38 Get started on 2.2a2 NEWS. 2001-07-21 02:31:40 +00:00
Fred Drake 960fdf9ac3 Added the constants ascii_letters, ascii_lowercase, and ascii_uppercase
to the string module.  This was determined to be the right approach in
SF bug #226706.
2001-07-20 18:38:26 +00:00
Martin v. Löwis f0473d511b Patch #412229: Add functions sys.getdlopenflags and sys.setdlopenflags.
Add dlopenflags to PyInterpreterState, and use it in dlopen calls.
2001-07-18 16:17:16 +00:00
Tim Peters 11a0d10845 Typo repair. 2001-07-17 18:48:00 +00:00
Guido van Rossum 55a78992da - Add news about generators.
- Change header to 2.2a1.
- Add separator between 2.2 and 2.1 news.
2001-07-17 17:22:32 +00:00
Guido van Rossum c7e4aca56c Add xmlrpc.
(Tim & I should agree on where to add new additions: I add them at the
top, Tim adds them at the bottom.  I like the top better because folks
who occasionally check out the NEWS file will see the latest news
first.)
2001-07-12 11:54:37 +00:00
Guido van Rossum 643d3916d5 News about xrange(). 2001-07-05 14:46:25 +00:00
Barry Warsaw 51acc8d363 Add an item about the extension to {}.update() to allow generic
mapping objects as an argument.
2001-06-26 20:12:50 +00:00
Tim Peters d6d010b874 Teach the UNPACK_SEQUENCE opcode how to tease an iterable object into
giving up the goods.
NEEDS DOC CHANGES
2001-06-21 02:49:55 +00:00
Tim Peters 52e155e31b Reformat decl of new _PyString_Join. Add NEWS blurb about repr() speedup. 2001-06-16 05:42:57 +00:00
Guido van Rossum 83213cc0a0 Add new built-in 'help' which invokes pydoc.help (with a twist). 2001-06-12 16:48:52 +00:00
Tim Peters 7a3bfc3a47 Added q/Q standard (x-platform 8-byte ints) mode in struct module.
This completes the q/Q project.

longobject.c _PyLong_AsByteArray:  The original code had a gross bug:
the most-significant Python digit doesn't necessarily have SHIFT
significant bits, and you really need to count how many copies of the sign
bit it has else spurious overflow errors result.

test_struct.py:  This now does exhaustive std q/Q testing at, and on both
sides of, all relevant power-of-2 boundaries, both positive and negative.

NEWS:  Added brief dict news while I was at it.
2001-06-12 01:22:22 +00:00
Tim Peters 7b9542a3f7 Initial support for 'q' and 'Q' struct format codes: for now, only in
native mode, and only when config #defines HAVE_LONG_LONG.  Standard mode
will eventually treat them as 8-byte ints across all platforms, but that
likely requires a new set of routines in longobject.c first (while
sizeof(long) >= 4 is guaranteed by C, there's nothing in C we can rely
on x-platform to hold 8 bytes of int, so we'll have to roll our own;
I'm thinking of a simple pair of conversion functions, Python long
to/from sized vector of unsigned bytes; that may be useful for GMP
conversions too; std q/Q would call them with size fixed at 8).

test_struct.py:  In addition to adding some native-mode 'q' and 'Q' tests,
got rid of unused code, and repaired a non-portable assumption about
native sizeof(short) (it isn't 2 on some Cray boxes).

libstruct.tex:  In addition to adding a bit of 'q'/'Q' docs (more needed
later), removed an erroneous footnote about 'I' behavior.
2001-06-10 23:40:19 +00:00
Guido van Rossum c341580afd Added quopri codec. 2001-06-06 13:30:54 +00:00
Martin v. Löwis ebf94db60b Report on fnmatch.filter. 2001-06-06 06:25:40 +00:00
Tim Peters eb28ef209e New collision resolution scheme: no polynomials, simpler, faster, less
code, less memory.  Tests have uncovered no drawbacks.  Christian and
Vladimir are the other two people who have burned many brain cells on the
dict code in recent years, and they like the approach too, so I'm checking
it in without further ado.
2001-06-02 05:27:19 +00:00
Tim Peters 4324aa3572 Cruft cleanup: Removed the unused last_is_sticky argument from the internal
_PyTuple_Resize().
2001-05-28 22:30:08 +00:00
Tim Peters 15d4929ae4 Implement an old idea of Christian Tismer's: use polynomial division
instead of multiplication to generate the probe sequence.  The idea is
recorded in Python-Dev for Dec 2000, but that version is prone to rare
infinite loops.

The value is in getting *all* the bits of the hash code to participate;
and, e.g., this speeds up querying every key in a dict with keys
 [i << 16 for i in range(20000)] by a factor of 500.  Should be equally
valuable in any bad case where the high-order hash bits were getting
ignored.

Also wrote up some of the motivations behind Python's ever-more-subtle
hash table strategy.
2001-05-27 07:39:22 +00:00
Tim Peters 1af03e98d9 Change list.extend() error msgs and NEWS to reflect that list.extend()
now takes any iterable argument, not only sequences.

NEEDS DOC CHANGES -- but I don't think we settled on a concise way to
say this stuff.
2001-05-26 19:37:54 +00:00
Barry Warsaw ffd674d400 - calendar.py uses month and day names based on the current locale. 2001-05-22 16:00:10 +00:00
Marc-André Lemburg 12e74b3cf2 Added NEWS item for the UTF-16 change. 2001-05-22 08:58:23 +00:00
Marc-André Lemburg fab96cc2ff Add NEWS item for new string methods. 2001-05-15 18:38:45 +00:00
Guido van Rossum 2e0a654f6e Add warnings to the strop module, for to those functions that really
*are* obsolete; three variables and the maketrans() function are not
(yet) obsolete.

Add a compensating warnings.filterwarnings() call to test_strop.py.

Add this to the NEWS.
2001-05-15 02:14:44 +00:00
Tim Peters 58e0a8c130 SF patch #418147 Fixes to allow compiling w/ Borland, from Stephen Hansen. 2001-05-14 22:32:33 +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
Guido van Rossum 1bd797a257 Fix a typo, consistently spell ASCII in all caps, and insert blank
lines between paragraphs in Mark Hammond's news item about the default
encoding in posixmodule.  Resist the temptation to reflow paragraphs.
2001-05-14 13:53:38 +00:00
Tim Peters a814db579d SF bug[ #423781: pprint.isrecursive() broken. 2001-05-14 07:05:58 +00:00
Mark Hammond 2a0af79269 Add mention of the default file system encoding for Windows. 2001-05-14 03:09:36 +00:00
Tim Peters 2f228e75e4 Get rid of the superstitious "~" in dict hashing's "i = (~hash) & mask".
The comment following used to say:
	/* We use ~hash instead of hash, as degenerate hash functions, such
	   as for ints <sigh>, can have lots of leading zeros. It's not
	   really a performance risk, but better safe than sorry.
	   12-Dec-00 tim:  so ~hash produces lots of leading ones instead --
	   what's the gain? */
That is, there was never a good reason for doing it.  And to the contrary,
as explained on Python-Dev last December, it tended to make the *sum*
(i + incr) & mask (which is the first table index examined in case of
collison) the same "too often" across distinct hashes.

Changing to the simpler "i = hash & mask" reduced the number of string-dict
collisions (== # number of times we go around the lookup for-loop) from about
6 million to 5 million during a full run of the test suite (these are
approximate because the test suite does some random stuff from run to run).
The number of collisions in non-string dicts also decreased, but not as
dramatically.

Note that this may, for a given dict, change the order (wrt previous
releases) of entries exposed by .keys(), .values() and .items().  A number
of std tests suffered bogus failures as a result.  For dicts keyed by
small ints, or (less so) by characters, the order is much more likely to be
in increasing order of key now; e.g.,

>>> d = {}
>>> for i in range(10):
...    d[i] = i
...
>>> d
{0: 0, 1: 1, 2: 2, 3: 3, 4: 4, 5: 5, 6: 6, 7: 7, 8: 8, 9: 9}
>>>

Unfortunately. people may latch on to that in small examples and draw a
bogus conclusion.

test_support.py
    Moved test_extcall's sortdict() into test_support, made it stronger,
    and imported sortdict into other std tests that needed it.
test_unicode.py
    Excluced cp875 from the "roundtrip over range(128)" test, because
    cp875 doesn't have a well-defined inverse for unicode("?", "cp875").
    See Python-Dev for excruciating details.
Cookie.py
    Chaged various output functions to sort dicts before building
    strings from them.
test_extcall
    Fiddled the expected-result file.  This remains sensitive to native
    dict ordering, because, e.g., if there are multiple errors in a
    keyword-arg dict (and test_extcall sets up many cases like that), the
    specific error Python complains about first depends on native dict
    ordering.
2001-05-13 00:19:31 +00:00
Tim Peters d85e102337 Variant of patch #423262: Change module attribute get & set
Allow module getattr and setattr to exploit string interning, via the
previously null module object tp_getattro and tp_setattro slots.   Yields
a very nice speedup for things like random.random and os.path etc.
2001-05-11 21:51:48 +00:00
Tim Peters 95bf9390a4 SF bug #422121 Insecurities in dict comparison.
Fixed a half dozen ways in which general dict comparison could crash
Python (even cause Win98SE to reboot) in the presence of kay and/or
value comparison routines that mutate the dict during dict comparison.
Bugfix candidate.
2001-05-10 08:32:44 +00:00
Tim Peters 61dff2b285 Blurb about the increased precision of float literals in .pyc/.pyo files. 2001-05-08 15:43:37 +00:00
Tim Peters e63415ead8 SF patch #421922: Implement rich comparison for dicts.
d1 == d2 and d1 != d2 now work even if the keys and values in d1 and d2
don't support comparisons other than ==, and testing dicts for equality
is faster now (especially when inequality obtains).
2001-05-08 04:38:29 +00:00