]> granicus.if.org Git - python/log
python
23 years ago(py-version): Hopefully fixed my XEmacs settings so this doesn't get
Barry Warsaw [Fri, 6 Jul 2001 20:27:29 +0000 (20:27 +0000)]
(py-version): Hopefully fixed my XEmacs settings so this doesn't get
clobbered on checkin.

23 years agoAmazing. A very subtle change in policy in descr-branch actually
Guido van Rossum [Fri, 6 Jul 2001 20:26:31 +0000 (20:26 +0000)]
Amazing.  A very subtle change in policy in descr-branch actually
found a bug here.  Here's the deal:

Class PyShell derives from class OutputWindow.  Method PyShell.close()
wants to invoke its parent method, but because PyShell long ago was
inherited from class PyShellEditorWindow, it invokes
PyShelEditorWindow.close(self).  Now, class PyShellEditorWindow itself
derives from class OutputWindow, and inherits the close() method from
there without overriding it.  Under the old rules,
PyShellEditorWindow.close would return an unbound method restricted to
the class that defined the implementation of close(), which was
OutputWindow.close.  Under the new rules, the unbound method is
restricted to the class whose method was requested, that is
PyShellEditorWindow, and this was correctly trapped as an error.

23 years agoFix up a few style nits -- avoid "e.g." and "i.e." -- these make
Fred Drake [Fri, 6 Jul 2001 20:23:02 +0000 (20:23 +0000)]
Fix up a few style nits -- avoid "e.g." and "i.e." -- these make
translation more difficult, as well as reading the English more
difficult for non-native speakers.

Add an index entry for the Telnet protocol.

Always refer to the protocol as Telnet instead of telnet.

23 years ago(py-continuation-offset): Update docstring to describe that this
Barry Warsaw [Fri, 6 Jul 2001 20:07:13 +0000 (20:07 +0000)]
(py-continuation-offset): Update docstring to describe that this
additional offset is only applied to continuation lines for block
opening statements.

(py-compute-indentation): Only add py-continuation-offset if
py-statement-opens-block-p is true.

23 years agoFix up a few style nits -- avoid "e.g." and "i.e." -- these make
Fred Drake [Fri, 6 Jul 2001 19:28:48 +0000 (19:28 +0000)]
Fix up a few style nits -- avoid "e.g." and "i.e." -- these make
translation more difficult, as well as reading the English more
difficult for non-native speakers.

23 years agoSF bug #439104: Tuple richcompares has code-typo.
Tim Peters [Fri, 6 Jul 2001 17:45:43 +0000 (17:45 +0000)]
SF bug #439104: Tuple richcompares has code-typo.
Symptom:  (1, 2, 3) <= (1, 2) returned 1.
This was already fixed in CVS for tuples, but an isomorphic error was in
the list richcompare code.

23 years agoFix up a few style nits -- avoid "e.g." and "i.e." -- these make
Fred Drake [Fri, 6 Jul 2001 17:28:39 +0000 (17:28 +0000)]
Fix up a few style nits -- avoid "e.g." and "i.e." -- these make
translation more difficult, as well as reading the English more
difficult for non-native speakers.

23 years agoWhen reading a continuation line, make sure we still use the transformed
Fred Drake [Fri, 6 Jul 2001 17:22:48 +0000 (17:22 +0000)]
When reading a continuation line, make sure we still use the transformed
name when filling in the internal data structures, otherwise we incorrectly
raise a KeyError.

This fixes SF bug #432369.

23 years agoExplain the exit code for the wait() method, including a reference to
Fred Drake [Fri, 6 Jul 2001 17:17:12 +0000 (17:17 +0000)]
Explain the exit code for the wait() method, including a reference to
the os.W*() functions used to interpret the return value.

This fixes SF bug #429361.

23 years agoFix up a few style nits -- avoid "e.g." and "i.e." -- these make
Fred Drake [Fri, 6 Jul 2001 06:49:32 +0000 (06:49 +0000)]
Fix up a few style nits -- avoid "e.g." and "i.e." -- these make
translation more difficult, as well as reading the English more
difficult for non-native speakers.

23 years agoRemoved fpectlmodule.c and fpetestmodule.c from the Windows build. They
Tim Peters [Thu, 5 Jul 2001 21:19:02 +0000 (21:19 +0000)]
Removed fpectlmodule.c and fpetestmodule.c from the Windows build.  They
weren't functional under Windows even if enabled.

23 years agoThe fpectl module does not work on Windows, so remove Windows from the
Fred Drake [Thu, 5 Jul 2001 21:17:08 +0000 (21:17 +0000)]
The fpectl module does not work on Windows, so remove Windows from the
\platform statement.

Also fix a minor style consistency nit in an example.

23 years agoFix a markup error: do not omit a method's parameter list if it is
Fred Drake [Thu, 5 Jul 2001 21:14:03 +0000 (21:14 +0000)]
Fix a markup error:  do not omit a method's parameter list if it is
empty.

23 years agoAllow underscores in tag names and quote characters in unquoted attribute
Fred Drake [Thu, 5 Jul 2001 18:21:57 +0000 (18:21 +0000)]
Allow underscores in tag names and quote characters in unquoted attribute
values.  The change for attribute values matches the way Mozilla and
Navigator view the world, at least.

This closes SF bug #436621.

23 years agoAdded more information on the differences between the htmllib and HTMLParser
Fred Drake [Thu, 5 Jul 2001 16:34:36 +0000 (16:34 +0000)]
Added more information on the differences between the htmllib and HTMLParser
modules.

23 years agoList constraints on xrange() objects.
Guido van Rossum [Thu, 5 Jul 2001 15:27:19 +0000 (15:27 +0000)]
List constraints on xrange() objects.

23 years agoRip out tests for xrange() features no longer supported.
Guido van Rossum [Thu, 5 Jul 2001 14:49:21 +0000 (14:49 +0000)]
Rip out tests for xrange() features no longer supported.

23 years agoNews about xrange().
Guido van Rossum [Thu, 5 Jul 2001 14:46:25 +0000 (14:46 +0000)]
News about xrange().

23 years agoComplete the xrange-simplification checkins: call PyRange_New() with
Guido van Rossum [Thu, 5 Jul 2001 14:44:41 +0000 (14:44 +0000)]
Complete the xrange-simplification checkins: call PyRange_New() with
fewer arguments.

23 years agoRip out the fancy behaviors of xrange that nobody uses: repeat, slice,
Guido van Rossum [Thu, 5 Jul 2001 13:27:48 +0000 (13:27 +0000)]
Rip out the fancy behaviors of xrange that nobody uses: repeat, slice,
contains, tolist(), and the start/stop/step attributes.  This includes
removing the 4th ('repeat') argument to PyRange_New().

23 years ago- minor cleanup, removed bogus comments
Just van Rossum [Thu, 5 Jul 2001 07:06:26 +0000 (07:06 +0000)]
- minor cleanup, removed bogus comments
- make method reload handle __private attrs correctly
- fixed whole word search

23 years agodon't crash when encountering bad marshal data
Just van Rossum [Thu, 5 Jul 2001 07:03:16 +0000 (07:03 +0000)]
don't crash when encountering bad marshal data

23 years agoSF bug #438295: [Windows] __init__.py cause strange behavior
Tim Peters [Thu, 5 Jul 2001 03:47:53 +0000 (03:47 +0000)]
SF bug #438295: [Windows] __init__.py cause strange behavior
Probable fix (the bug report doesn't have enough info to say for sure).
find_init_module():  Insist on a case-sensitive match for __init__ files.
Given __INIT__.PY instead, find_init_module() thought that was fine, but
the later attempt to do find_module("__INIT__.PY") didn't and its caller
silently suppressed the resulting ImportError.  Now find_init_module()
refuses to accept __INIT__.PY to begin with.
Bugfix candidate; specific to platforms with case-insensitive filesystems.

23 years agoDo conversion of CFStrings to/from unicode.
unknown [Wed, 4 Jul 2001 22:38:52 +0000 (22:38 +0000)]
Do conversion of CFStrings to/from unicode.

23 years agoSet the default 8-bit encoding based on the system script and language.
unknown [Wed, 4 Jul 2001 22:37:19 +0000 (22:37 +0000)]
Set the default 8-bit encoding based on the system script and language.

23 years agoDon't promise mac-japanese encoding as we don't have a codec for it.
unknown [Wed, 4 Jul 2001 22:36:27 +0000 (22:36 +0000)]
Don't promise mac-japanese encoding as we don't have a codec for it.
Return a reasonable name for the general macos exception (MacOS.Error).

23 years agoAdded a non-recursive implementation of conjoin(), and a Knight's Tour
unknown [Wed, 4 Jul 2001 22:11:22 +0000 (22:11 +0000)]
Added a non-recursive implementation of conjoin(), and a Knight's Tour
solver.  In conjunction, they easily found a tour of a 200x200 board:
that's 200**2 == 40,000 levels of backtracking.  Explicitly resumable
generators allow that to be coded as easily as a recursive solver (easier,
actually, because different levels can use level-customized algorithms
without pain), but without blowing the stack.  Indeed, I've never written
an exhaustive Tour solver in any language before that can handle boards so
large ("exhaustive" == guaranteed to find a solution if one exists, as
opposed to probabilistic heuristic approaches; of course, the age of the
universe may be a blip in the time needed!).

23 years agodummy checkin for testing, please ignore
unknown [Wed, 4 Jul 2001 16:52:02 +0000 (16:52 +0000)]
dummy checkin for testing, please ignore

23 years agoFix for SF bug #425868.
unknown [Wed, 4 Jul 2001 10:15:58 +0000 (10:15 +0000)]
Fix for SF bug #425868.
We should not depend on two spaces between words, so use the white
space after the to-be-encoded word only as lookahead and don't
actually consume it in the regular expression.

23 years agoClean up a bare except: clause.
unknown [Wed, 4 Jul 2001 07:07:33 +0000 (07:07 +0000)]
Clean up a bare except: clause.

23 years agoClean up a bare except: clause.
unknown [Wed, 4 Jul 2001 07:01:29 +0000 (07:01 +0000)]
Clean up a bare except: clause.

23 years agoMake the implementations of getElementsByTagName() and
Fred Drake [Wed, 4 Jul 2001 06:25:53 +0000 (06:25 +0000)]
Make the implementations of getElementsByTagName() and
getElementsByTagNameNS() consistent in form as well as functionality
(cosmetic).

23 years agoOnly write out one blank line before the request data.
Fred Drake [Wed, 4 Jul 2001 05:18:29 +0000 (05:18 +0000)]
Only write out one blank line before the request data.
This closes SF patch #419459.

23 years agoNull commit with -f option to force an uprev and put HEADs firmly on the trunk.
Kurt B. Kaiser [Wed, 4 Jul 2001 03:43:58 +0000 (03:43 +0000)]
Null commit with -f option to force an uprev and put HEADs firmly on the trunk.

23 years agoNull commit with -f option to force an uprev and put HEADs firmly on the trunk.
Kurt B. Kaiser [Wed, 4 Jul 2001 03:15:10 +0000 (03:15 +0000)]
Null commit with -f option to force an uprev and put HEADs firmly on the trunk.

23 years agoThis change adjusts the profiling/tracing support so that the common
Fred Drake [Tue, 3 Jul 2001 23:39:52 +0000 (23:39 +0000)]
This change adjusts the profiling/tracing support so that the common
path (with no profile/trace function) through eval_code2() and
eval_frame() avoids several checks.

In the common cases of calls, returns, and exception propogation,
eval_code2() and eval_frame() used to test two values in the
thread-state: the profiling function and the tracing function.  With
this change, a flag is set in the thread-state if either of these is
active, allowing a single check to suffice when both are NULL.  This
also simplifies the code needed when either function is in use but is
already active (to avoid profiling/tracing the profiler/tracer); the
flag is set to 0 when the profile/trace code is entered, allowing the
same check to suffice for "already in the tracer" for call/return/
exception events.

23 years agobug #416670
Fredrik Lundh [Tue, 3 Jul 2001 20:32:36 +0000 (20:32 +0000)]
bug #416670

added copy/deepcopy support to SRE (still not enabled, since it's not
covered by the test suite)

23 years agobug #232815
Fredrik Lundh [Tue, 3 Jul 2001 19:27:05 +0000 (19:27 +0000)]
bug #232815

ch is unsigned, so testing for negative values doesn't make
sense (as noticed by the OpenVMS compiler)

23 years agoMarked the parameters to Stats.print_*() as optional.
Fred Drake [Mon, 2 Jul 2001 21:22:39 +0000 (21:22 +0000)]
Marked the parameters to Stats.print_*() as optional.

This closes SF bug #438032.

23 years agoreapplied darryl gallion's minimizing repeat fix. I'm still not 100%
Fredrik Lundh [Mon, 2 Jul 2001 19:54:28 +0000 (19:54 +0000)]
reapplied darryl gallion's minimizing repeat fix.  I'm still not 100%
sure about this one, but test #133283 now works even with the fix in
place, and so does the test suite.  we'll see what comes up...

23 years agoAdd another name.
Fred Drake [Mon, 2 Jul 2001 17:16:07 +0000 (17:16 +0000)]
Add another name.

23 years agopythonware repository roundtrip (untabification)
Fredrik Lundh [Mon, 2 Jul 2001 17:04:48 +0000 (17:04 +0000)]
pythonware repository roundtrip (untabification)

23 years agoadded martin's BIGCHARSET patch to SRE 2.1.1. martin reports 2x
Fredrik Lundh [Mon, 2 Jul 2001 16:58:38 +0000 (16:58 +0000)]
added martin's BIGCHARSET patch to SRE 2.1.1.  martin reports 2x
speedups for certain unicode character ranges.

23 years agoAvoid using os.path.normcase() on sys.path elements; doing so causes paths
Fred Drake [Mon, 2 Jul 2001 16:55:42 +0000 (16:55 +0000)]
Avoid using os.path.normcase() on sys.path elements; doing so causes paths
to be presented in an unfamiliar case on case-preserving filesystems.

This closes SF patch #436173.

23 years agomerged with pythonware's SRE 2.1.1 codebase
Fredrik Lundh [Mon, 2 Jul 2001 16:42:49 +0000 (16:42 +0000)]
merged with pythonware's SRE 2.1.1 codebase

23 years agoAdded the new unicode defines. Not really tested yet, but Python compiles again at...
Jack Jansen [Mon, 2 Jul 2001 15:34:57 +0000 (15:34 +0000)]
Added the new unicode defines. Not really tested yet, but Python compiles again at least.

23 years agoNuke hard tabs.
Tim Peters [Mon, 2 Jul 2001 04:59:35 +0000 (04:59 +0000)]
Nuke hard tabs.

23 years agoWhitespace normalization; the plat-riscos file didn't even get by
Tim Peters [Mon, 2 Jul 2001 04:57:30 +0000 (04:57 +0000)]
Whitespace normalization; the plat-riscos file didn't even get by
tabnanny.py.

23 years agoAdd tentative 2.1.1 Windows build numbers.
Tim Peters [Mon, 2 Jul 2001 04:08:39 +0000 (04:08 +0000)]
Add tentative 2.1.1 Windows build numbers.

23 years agoA clever union-find implementation from c.l.py, due to David Eppstein.
Tim Peters [Mon, 2 Jul 2001 01:38:33 +0000 (01:38 +0000)]
A clever union-find implementation from c.l.py, due to David Eppstein.
This is another one that leaks memory without an explict clear!  Time to
bite this bullet.

23 years agoAdded WeakLink...Generator classes (should have done that ages ago). These check...
Jack Jansen [Sun, 1 Jul 2001 22:09:29 +0000 (22:09 +0000)]
Added WeakLink...Generator classes (should have done that ages ago). These check the c-function pointer for being NULL before calling it and raise UnimplementedError if it is.

This allows system libs to be weak-linked, thereby allowing us to generate functions that are only available on some OS versions without getting a NULL dereference if the function isn't available.

23 years ago- Use weaklink generators so we can support OSX-only calls without crashing on OS9.
Jack Jansen [Sun, 1 Jul 2001 22:04:02 +0000 (22:04 +0000)]
- Use weaklink generators so we can support OSX-only calls without crashing on OS9.
- Convert CFString to/from Python strings. Currently always MacRoman, to be fixed later (as is unicode support). Python->CFString conversion is automatic.

23 years agoDerive an industrial-strength conjoin() via cross-recursion loop unrolling,
Tim Peters [Sat, 30 Jun 2001 07:29:44 +0000 (07:29 +0000)]
Derive an industrial-strength conjoin() via cross-recursion loop unrolling,
and fiddle the conjoin tests to exercise all the new possible paths.

23 years agoTurns out Neil didn't intend for *all* of his gen-branch work to get
Tim Peters [Fri, 29 Jun 2001 23:51:08 +0000 (23:51 +0000)]
Turns out Neil didn't intend for *all* of his gen-branch work to get
committed.

tokenize.py:  I like these changes, and have tested them extensively
without even realizing it, so I just updated the docstring and the docs.

tabnanny.py:  Also liked this, but did a little code fiddling.  I should
really rewrite this to *exploit* generators, but that's near the bottom
of my effort/benefit scale so doubt I'll get to it anytime soon (it
would be most useful as a non-trivial example of ideal use of generators;
but test_generators.py has already grown plenty of food-for-thought
examples).

inspect.py:  I'm sure Ping intended for this to continue running even
under 1.5.2, so I reverted this to the last pre-gen-branch version.  The
"bugfix" I checked in in-between was actually repairing a bug *introduced*
by the conversion to generators, so it's OK that the reverted version
doesn't reflect that checkin.

23 years agoUse the more conventional "self" as the name of the self parameter in an
Fred Drake [Fri, 29 Jun 2001 17:50:57 +0000 (17:50 +0000)]
Use the more conventional "self" as the name of the self parameter in an
example.  It actually confused a reader.

23 years agoCorrect a markup error for an accented character.
Fred Drake [Fri, 29 Jun 2001 16:25:07 +0000 (16:25 +0000)]
Correct a markup error for an accented character.

Reported by Milan Zamazal <pdm@zamazal.org>.

23 years agoRemoved some stray periods, and fix up a number of visible markup
Fred Drake [Fri, 29 Jun 2001 16:21:47 +0000 (16:21 +0000)]
Removed some stray periods, and fix up a number of visible markup
consistency errors (mostly omitted "()" at the end of function and
method names).

Reported by Milan Zamazal <pdm@zamazal.org>.

23 years agoTwo more names.
Fred Drake [Fri, 29 Jun 2001 15:42:20 +0000 (15:42 +0000)]
Two more names.

23 years agoSourceForge bug #437041:
Fred Drake [Fri, 29 Jun 2001 15:39:53 +0000 (15:39 +0000)]
SourceForge bug #437041:
Use a portable format in the example that creates a timestamp suitable for
use in email, also updating it and the footnote from RFC 822 to RFC 2822.

23 years agoSimplify an example based on comment from Thomas Holenstein <thomas@hex.ch>:
Fred Drake [Fri, 29 Jun 2001 14:59:01 +0000 (14:59 +0000)]
Simplify an example based on comment from Thomas Holenstein <thomas@hex.ch>:
Do not use an extra flag variable to test only once in one subsequent if
statement.

23 years agoSolve SF bug #231249: cgi.py opens too many (temporary) files.
Guido van Rossum [Fri, 29 Jun 2001 13:06:06 +0000 (13:06 +0000)]
Solve SF bug #231249: cgi.py opens too many (temporary) files.

class FieldStorage: this patch changes read_lines() and co. to use a
StringIO() instead of a real file.  The write() calls are redirected
to a private method that replaces it with a real, external file only
when it gets too big (> 1000 bytes).

This avoids problems in forms using the multipart/form-data encoding
with many fields.  The original code created a temporary file for
*every* field (not just for file upload fields), thereby sometimes
exceeding the open file limit of some systems.

Note that the simpler solution "use a real file only for file uploads"
can't be used because the form field parser has no way to tell which
fields correspond to file uploads.

It's *possible* but extremely unlikely that this would break someone's
code; they would have to be stepping way outside the documented
interface for FieldStorage and use f.file.fileno(), or depend on
overriding make_file() to return a file-like object with additional
known properties.

23 years agoAdded a simple but general backtracking generator (conjoin), and a couple
Tim Peters [Fri, 29 Jun 2001 02:41:16 +0000 (02:41 +0000)]
Added a simple but general backtracking generator (conjoin), and a couple
examples of use.  These poke stuff not specifically targeted before, incl.
recursive local generators relying on nested scopes, ditto but also
inside class methods and rebinding instance vars, and anonymous
partially-evaluated generators (the N-Queens solver creates a different
column-generator for each row -- AFAIK this is my invention, and it's
really pretty <wink>).  No problems, not even a new leak.

23 years agoAdded CFURL support, and got base chaining to really work.
Jack Jansen [Thu, 28 Jun 2001 22:08:26 +0000 (22:08 +0000)]
Added CFURL support, and got base chaining to really work.

23 years agoMake basechain a class variable in stead of initializing it in __init__. That way...
Jack Jansen [Thu, 28 Jun 2001 22:07:30 +0000 (22:07 +0000)]
Make basechain a class variable in stead of initializing it in __init__. That way it's more easily overridden.

23 years agoAnother "if 0:" hack, this time to complain about otherwise invisible
Tim Peters [Thu, 28 Jun 2001 01:52:22 +0000 (01:52 +0000)]
Another "if 0:" hack, this time to complain about otherwise invisible
"return expr" instances in generators (which latter may be generators
due to otherwise invisible "yield" stmts hiding in "if 0" blocks).
This was fun the first time, but this has gotten truly ugly now.

23 years agoremoved "register const" from scalar arguments to the unicode
Fredrik Lundh [Wed, 27 Jun 2001 22:08:26 +0000 (22:08 +0000)]
removed "register const" from scalar arguments to the unicode
predicates

23 years agoCFArray, CFData and CFDictonary are now covered, but mainly opaque.
Jack Jansen [Wed, 27 Jun 2001 22:00:55 +0000 (22:00 +0000)]
CFArray, CFData and CFDictonary are now covered, but mainly opaque.
CFStrings are in better shape, but Unicode support and automatic conversion to/from Python strings remains to be done.

23 years agoAdded a couple more types that Apple has taken a fancy to.
Jack Jansen [Wed, 27 Jun 2001 21:58:40 +0000 (21:58 +0000)]
Added a couple more types that Apple has taken a fancy to.

23 years agoAdd more items that need to be written about
Andrew M. Kuchling [Wed, 27 Jun 2001 20:32:12 +0000 (20:32 +0000)]
Add more items that need to be written about

23 years agoDefault to ucs2 when no argument to --enable-unicode is specified.
Martin v. Löwis [Wed, 27 Jun 2001 20:22:04 +0000 (20:22 +0000)]
Default to ucs2 when no argument to --enable-unicode is specified.

23 years agomake wchar_t usable again on Windows (this enables the MBCS codecs)
Fredrik Lundh [Wed, 27 Jun 2001 19:49:17 +0000 (19:49 +0000)]
make wchar_t usable again on Windows (this enables the MBCS codecs)

23 years agoRevise the interface to the profiling and tracing support for the
Fred Drake [Wed, 27 Jun 2001 19:19:46 +0000 (19:19 +0000)]
Revise the interface to the profiling and tracing support for the
Python interpreter.

This change adds two new C-level APIs:  PyEval_SetProfile() and
PyEval_SetTrace().  These can be used to install profile and trace
functions implemented in C, which can operate at much higher speeds
than Python-based functions.  The overhead for calling a C-based
profile function is a very small fraction of a percent of the overhead
involved in calling a Python-based function.

The machinery required to call a Python-based profile or trace
function been moved to sysmodule.c, where sys.setprofile() and
sys.setprofile() simply become users of the new interface.

As a side effect, SF bug #436058 is fixed; there is no longer a
_PyTrace_Init() function to declare.

23 years agoRevise the interface to the profiling and tracing support for the
Fred Drake [Wed, 27 Jun 2001 19:18:03 +0000 (19:18 +0000)]
Revise the interface to the profiling and tracing support for the
Python interpreter.

This change adds two new C-level APIs:  PyEval_SetProfile() and
PyEval_SetTrace().  These can be used to install profile and trace
functions implemented in C, which can operate at much higher speeds
than Python-based functions.  The overhead for calling a C-based
profile function is a very small fraction of a percent of the overhead
involved in calling a Python-based function.

The machinery required to call a Python-based profile or trace
function been moved to sysmodule.c, where sys.setprofile() and
sys.setprofile() simply become users of the new interface.

23 years agouse Py_UNICODE_WIDE instead of USE_UCS4_STORAGE and Py_UNICODE_SIZE
Fredrik Lundh [Wed, 27 Jun 2001 18:59:43 +0000 (18:59 +0000)]
use Py_UNICODE_WIDE instead of USE_UCS4_STORAGE and Py_UNICODE_SIZE
tests.

23 years agoReplace the text with a link to the PEP-ified version.
Barry Warsaw [Wed, 27 Jun 2001 17:14:04 +0000 (17:14 +0000)]
Replace the text with a link to the PEP-ified version.

23 years agoRemove duplicate ', ' in dbhash.open()'s argument list.
Thomas Wouters [Wed, 27 Jun 2001 13:49:59 +0000 (13:49 +0000)]
Remove duplicate ', ' in dbhash.open()'s argument list.

23 years agoThis no longer leaks memory when run in an infinite loop. However,
Tim Peters [Wed, 27 Jun 2001 07:17:57 +0000 (07:17 +0000)]
This no longer leaks memory when run in an infinite loop.  However,
that required explicitly calling LazyList.clear() in the two tests that
use LazyList (I added a LazyList Fibonacci generator too).

A real bitch:  the extremely inefficient first version of the 2-3-5 test
*looked* like a slow leak on Win98SE, but it wasn't "really":  it generated
so many results that the heap grew over 4Mb (tons of frames!  the number
of frames grows exponentially in that test).  Then Win98SE malloc() starts
fragmenting address space allocating more and more heaps, and the visible
memory use grew very slowly while the disk was thrashing like mad.
Printing fewer results (i.e., keeping the heap burden under 4Mb) made
that illusion vanish.

Looks like there's no hope for plugging the LazyList leaks automatically
short of adding frameobjects and genobjects to gc.  OTOH, they're very
easy to break by hand, and they're the only *kind* of plausibly realistic
leaks I've been able to provoke.

Dilemma.

23 years agoEncode surrogates in UTF-8 even for a wide Py_UNICODE.
Martin v. Löwis [Wed, 27 Jun 2001 06:28:56 +0000 (06:28 +0000)]
Encode surrogates in UTF-8 even for a wide Py_UNICODE.
Implement sys.maxunicode.
Explicitly wrap around upper/lower computations for wide Py_UNICODE.
When decoding large characters with UTF-8, represent expected test
results using the \U notation.

23 years agoCosmetic changes to MvL's change to unichr():
Guido van Rossum [Tue, 26 Jun 2001 23:12:25 +0000 (23:12 +0000)]
Cosmetic changes to MvL's change to unichr():

- the correct range for the error message is range(0x110000);

- put the 4-byte Unicode-size code inside the same else branch as the
  2-byte code, rather generating unreachable code in the 2-byte case.

- Don't hide the 'else' behine the '}'.

(I would prefer that in 4-byte mode, any value should be accepted, but
reasonable people can argue about that, so I'll put that off.)

23 years agoMake Unicode work a bit better on Windows...
Fredrik Lundh [Tue, 26 Jun 2001 22:59:49 +0000 (22:59 +0000)]
Make Unicode work a bit better on Windows...

23 years agoWhen decoding UTF-16, don't assume that the buffer is in native endianness
Martin v. Löwis [Tue, 26 Jun 2001 22:43:40 +0000 (22:43 +0000)]
When decoding UTF-16, don't assume that the buffer is in native endianness
when checking surrogates.

23 years agoWindows build broke from recent Unicode changes -- need to #define
Tim Peters [Tue, 26 Jun 2001 22:40:47 +0000 (22:40 +0000)]
Windows build broke from recent Unicode changes -- need to #define
SIZEOF_SHORT by hand here.
Also added dynamic check that SIZEOF_SHORT is correct for the platform (in
_testcapimodule).

23 years agogen_getattr: make the gi_running and gi_frame members discoverable (but
Tim Peters [Tue, 26 Jun 2001 22:24:51 +0000 (22:24 +0000)]
gen_getattr:  make the gi_running and gi_frame members discoverable (but
not writable -- too dangerous!) from Python code.

23 years agoSupport using UCS-4 as the Py_UNICODE type:
Martin v. Löwis [Tue, 26 Jun 2001 22:22:37 +0000 (22:22 +0000)]
Support using UCS-4 as the Py_UNICODE type:
Add configure option --enable-unicode.
Add config.h macros Py_USING_UNICODE, PY_UNICODE_TYPE, Py_UNICODE_SIZE,
                    SIZEOF_WCHAR_T.
Define Py_UCS2.
Encode and decode large UTF-8 characters into single Py_UNICODE values
for wide Unicode types; likewise for UTF-16.
Remove test whether sizeof Py_UNICODE is two.

23 years agoAdded a Parser_OSX class that can parse new-style (C-only) headers,
Jack Jansen [Tue, 26 Jun 2001 21:53:25 +0000 (21:53 +0000)]
Added a Parser_OSX class that can parse new-style (C-only) headers,
such as the Core Foundation ones.

23 years agoAdded CF module build and project generation (carbon only).
Jack Jansen [Tue, 26 Jun 2001 21:52:08 +0000 (21:52 +0000)]
Added CF module build and project generation (carbon only).

23 years agoFirst small step towards bgen-generated CoreFoundation. there is hardly any real...
Jack Jansen [Tue, 26 Jun 2001 21:51:18 +0000 (21:51 +0000)]
First small step towards bgen-generated CoreFoundation. there is hardly any real functionality yet, but method chains seem to work, and so do Retain/Release semantics.

23 years agoAdd "gi_" (generator-iterator) prefix to names of genobject members.
Tim Peters [Tue, 26 Jun 2001 20:58:58 +0000 (20:58 +0000)]
Add "gi_" (generator-iterator) prefix to names of genobject members.
Makes it much easier to find references via dumb editor search (former
"frame" in particular was near-hopeless).

23 years agomore unicode tweaks: fix unicodectype for sizeof(Py_UNICODE) >
Fredrik Lundh [Tue, 26 Jun 2001 20:36:12 +0000 (20:36 +0000)]
more unicode tweaks: fix unicodectype for sizeof(Py_UNICODE) >
sizeof(int)

23 years agoRemove the restriction on a mapping's .update() method.
Barry Warsaw [Tue, 26 Jun 2001 20:32:59 +0000 (20:32 +0000)]
Remove the restriction on a mapping's .update() method.

23 years agoAdd an item about the extension to {}.update() to allow generic
Barry Warsaw [Tue, 26 Jun 2001 20:12:50 +0000 (20:12 +0000)]
Add an item about the extension to {}.update() to allow generic
mapping objects as an argument.

23 years agoAdd a bunch of tests for extended dict.update() where the argument is
Barry Warsaw [Tue, 26 Jun 2001 20:09:28 +0000 (20:09 +0000)]
Add a bunch of tests for extended dict.update() where the argument is
a non-dictionary mapping object.  Include tests for several expected
failure modes.

23 years agodict_update(): Generalize this method so {}.update() accepts any
Barry Warsaw [Tue, 26 Jun 2001 20:08:32 +0000 (20:08 +0000)]
dict_update(): Generalize this method so {}.update() accepts any
"mapping" object, specifically one that supports PyMapping_Keys() and
PyObject_GetItem().  This allows you to say e.g. {}.update(UserDict())

We keep the special case for concrete dict objects, although that
seems moderately questionable.  OTOH, the code exists and works, so
why change that?

.update()'s docstring already claims that D.update(E) implies calling
E.keys() so it's appropriate not to transform AttributeErrors in
PyMapping_Keys() to TypeErrors.

Patch eyeballed by Tim.

23 years agomore unicode tweaks: make unichr(0xdddddddd) behave like u"\Udddddddd"
Fredrik Lundh [Tue, 26 Jun 2001 20:01:56 +0000 (20:01 +0000)]
more unicode tweaks: make unichr(0xdddddddd) behave like u"\Udddddddd"
wrt surrogates.  (this extends the valid range from 65535 to 1114111)

23 years agoexperimental UCS-4 support: don't assume that MS_WIN32 implies
Fredrik Lundh [Tue, 26 Jun 2001 17:46:10 +0000 (17:46 +0000)]
experimental UCS-4 support: don't assume that MS_WIN32 implies
HAVE_USABLE_WCHAR_T

23 years agoexperimental UCS-4 support: added USE_UCS4_STORAGE define to
Fredrik Lundh [Tue, 26 Jun 2001 17:17:07 +0000 (17:17 +0000)]
experimental UCS-4 support: added USE_UCS4_STORAGE define to
unicodeobject.h, which forces sizeof(Py_UNICODE) == sizeof(Py_UCS4).
(this may be good enough for platforms that doesn't have a 16-bit
type.  the UTF-16 codecs don't work, though)

23 years agoexperimental UCS-4 support: made compare a bit more robust, in case
Fredrik Lundh [Tue, 26 Jun 2001 16:39:36 +0000 (16:39 +0000)]
experimental UCS-4 support: made compare a bit more robust, in case
sizeof(Py_UNICODE) >= sizeof(long).  also changed surrogate expansion
to work if sizeof(Py_UNICODE) > 2.

23 years agoexperimental UCS-4 support: don't assume that MS_WIN32 implies
Fredrik Lundh [Tue, 26 Jun 2001 15:11:00 +0000 (15:11 +0000)]
experimental UCS-4 support: don't assume that MS_WIN32 implies
HAVE_USABLE_WCHAR_T

23 years agoAdded a note about recompiling OSAm before distributing.
Jack Jansen [Tue, 26 Jun 2001 08:06:59 +0000 (08:06 +0000)]
Added a note about recompiling OSAm before distributing.

23 years agoFixed typo in doc string.
Just van Rossum [Tue, 26 Jun 2001 06:57:12 +0000 (06:57 +0000)]
Fixed typo in doc string.