Commit Graph

25696 Commits

Author SHA1 Message Date
Tim Peters f36151556f A quicker astimezone() implementation, rehabilitating an earlier
suggestion from Guido, along with a formal correctness proof of the
trickiest bit.  The intricacy of the proof reveals how delicate this
is, but also how robust the conclusion:  correctness doesn't rely on
dst() returning +- one hour (not all real time zones do!), it only
relies on:

1. That dst() returns a (any) non-zero value if and only if daylight
   time is in effect.

and

2. That the tzinfo subclass implements a consistent notion of time zone.

The meaning of "consistent" was a hidden assumption, which is now an
explicit requirement in the docs.  Alas, it's an unverifiable (by the
datetime implementation) requirement, but so it goes.
2003-01-01 21:51:37 +00:00
Skip Montanaro 0233bd9c7d mention built-in constants. 2003-01-01 20:37:14 +00:00
Skip Montanaro 1f041e7aa8 process libconsts.tex 2003-01-01 20:34:00 +00:00
Skip Montanaro 17804b1df4 new section - builtin constants 2003-01-01 20:33:38 +00:00
Skip Montanaro 2cfc4725d5 add find-uname.py 2003-01-01 20:27:13 +00:00
Skip Montanaro f2c47114e7 Search for Unicode character names using regular expressions. 2003-01-01 20:26:47 +00:00
Skip Montanaro decc6a47df Split OPT make variable into OPT and BASECFLAGS. The latter contains those
compiler flags which are necessary to get a clean compile.  The former is
for user-specified optimizer, debug, trace fiddling.  See patch 640843.

Add /sw/lib and /sw/include to setup.py search paths on Darwin to take
advantage of fink goodies.

Add scriptsinstall target to Makefile to install certain scripts from
Tools/scripts directory.
2003-01-01 20:07:49 +00:00
Neal Norwitz dc392e3143 Move _PyInt_Init() into pythonrun.h, since all the other _Init()
functions are here.  Suggested by Skip.
2003-01-01 15:18:32 +00:00
Neal Norwitz 4e8f5492c5 Revert last change -- test works on HPUX again after Martin's checkin
to 'properly configure the slave terminal'

See SF patch # 656590 for the details.
2003-01-01 14:53:27 +00:00
Guido van Rossum 6a8f7b741c Silly little script to print statistics (files, lines, words) by
extension.  Could use some work, but already very useful.
2003-01-01 14:41:25 +00:00
Martin v. Löwis 14e73b1864 Expose I_ constants. Auto-detect stropts.h. Properly configure the slave terminal. 2003-01-01 09:51:12 +00:00
Fred Drake 33fb554a13 Revert merge from 2.3 alpha 1 release branch; the change does not
apply to the trunk.
2003-01-01 04:50:32 +00:00
Tim Peters b5a16f3375 datetimetz_astimezone(): Speed optimizations -- although I'd rather
find a more elegant algorithm (OTOH, the hairy new implementation allows
user-written tzinfo classes to be elegant, so it's a big win even if
astimezone() remains hairy).

Darn!  I've only got 10 minutes left to get falling-down drunk!  I suppose
I'll have to smoke crack instead now.
2003-01-01 04:48:01 +00:00
Tim Peters 36087edc05 The failure of the last-second addition to the timezone coversion test is
understood now:  it can't work.  Added comments explaining why (it's "the
usual"-- unrepresentable hours in local time --but in a slightly different
guise).
2003-01-01 04:18:51 +00:00
Tim Peters 88ad134e36 Merging in changes from r23a1-branch. Doc/makefile had conflicts, which
I leave to Fred to sort out.
2003-01-01 02:14:12 +00:00
Kurt B. Kaiser 50e9c4ff55 More installation info. Bump alpha version. 2003-01-01 01:14:13 +00:00
Kurt B. Kaiser 38f11101d8 Debugger was tracing through rpc.py when IDLEfork was not started
from its source directory.  Generalize the "workaround" (though
the latter seems a reasonable solution?) to handle this.
2003-01-01 00:26:41 +00:00
Kurt B. Kaiser 7cca3d8ef0 Improve exception handling. 2002-12-31 23:18:00 +00:00
Neal Norwitz 13af1142fc Try to get compilation working for cygwin 2002-12-31 21:55:16 +00:00
Jason Tishler bbe8961698 Patch #660485: Cygwin _tkinter Tcl/Tk 8.3 patch
The attached patch enables Cygwin Python to
build cleanly against the latest Cygwin Tcl/Tk
which is based on Tcl/Tk 8.3. It also prevents
building against the real X headers, if installed.
2002-12-31 20:30:46 +00:00
Fred Drake 8f1f8f13e4 The trunk is (nominally) post-alpha. 2002-12-31 20:26:25 +00:00
Guido van Rossum a3a243e977 Merge to trunk from release branch:
Plug the leak that Tim just reported.
2002-12-31 19:50:03 +00:00
Barry Warsaw b1dcbd223e Make two tests non-locale-dependent 2002-12-31 19:27:45 +00:00
Andrew M. Kuchling f15fb2926b Results of a rewrite pass 2002-12-31 18:34:54 +00:00
Fred Drake 0f8e543159 - use classdesc where we can (for better indexing)
- more style consistency crud
2002-12-31 18:31:48 +00:00
Jeremy Hylton 1856541142 Replace all but one explicit emit('SET_LINENO') with call to set_lineno().
Remove broken code in visitDict().  I assume the code was trying to
add set lineno events for each line of a dict constructor, but I think
it was using the wrong object (node instead of k or v).
2002-12-31 18:26:17 +00:00
Tony Lownds cf94ee817c Don't let the docstring end up in __main__.__doc__ 2002-12-31 18:22:37 +00:00
Barry Warsaw bc38baffbd test01_close_dbenv_before_db(): Added an XXX comment that this test is
BerkeleyDB version dependent.
2002-12-31 18:21:43 +00:00
Neal Norwitz 0aae2b07d7 Comment out test, since it hangs on HPUX, still investigating 2002-12-31 18:21:11 +00:00
Jeremy Hylton accb62b28e SF patch [ 597919 ] compiler package and SET_LINENO
A variety of changes from Michael Hudson to get the compiler working
with 2.3.  The primary change is the handling of SET_LINENO:

# The set_lineno() function and the explicit emit() calls for
# SET_LINENO below are only used to generate the line number table.
# As of Python 2.3, the interpreter does not have a SET_LINENO
# instruction.  pyassem treats SET_LINENO opcodes as a special case.

A few other small changes:
 - Remove unused code from pycodegen and pyassem.
 - Fix error handling in parsermodule.  When PyParser_SimplerParseString()
   fails, it sets an exception with detailed info.  The parsermodule
   was clobbering that exception and replacing it was a generic
   "could not parse string" exception.  Keep the original exception.
2002-12-31 18:17:44 +00:00
Fred Drake 436eadd455 General style conformance. Markup some unmarked constructs. 2002-12-31 18:13:11 +00:00
Kurt B. Kaiser 2cb540253b Update (slightly) for Alpha release 2002-12-31 18:12:04 +00:00
Martin v. Löwis 64aa5f6982 Remove bogus test; the master is not a terminal on Solaris and HP-UX. 2002-12-31 18:05:15 +00:00
Kurt B. Kaiser 085ce5a77a Move history to HISTORY.txt 2002-12-31 17:57:44 +00:00
Kurt B. Kaiser f5934dd5f8 Update for Alpha 0 Release 2002-12-31 17:56:18 +00:00
Guido van Rossum f970d61c92 Add recipe for creating NEWS.html. 2002-12-31 17:51:30 +00:00
Tim Peters 521fc15e62 A new, and much hairier, implementation of astimezone(), building on
an idea from Guido.  This restores that the datetime implementation
never passes a datetime d to a tzinfo method unless d.tzinfo is the
tzinfo instance whose method is being called.  That in turn allows
enormous simplifications in user-written tzinfo classes (see the Python
sandbox US.py and EU.py for fully fleshed-out examples).

d.astimezone(tz) also raises ValueError now if d lands in the one hour
of the year that can't be expressed in tz (this can happen iff tz models
both standard and daylight time).  That it used to return a nonsense
result always ate at me, and it turned out that it seemed impossible to
force a consistent nonsense result under the new implementation (which
doesn't know anything about how tzinfo classes implement their methods --
it can only infer properties indirectly).  Guido doesn't like this --
expect it to change.

New tests of conversion between adjacent DST-aware timezones don't pass
yet, and are commented out.

Running the datetime tests in a loop under a debug build leaks 9
references per test run, but I don't believe the datetime code is the
cause (it didn't leak the last time I changed the C code, and the leak
is the same if I disable all the tests that invoke the only function
that changed here).  I'll pursue that next.
2002-12-31 17:36:56 +00:00
Martin v. Löwis ba2f875d90 Eliminate C++ comment. 2002-12-31 17:34:30 +00:00
Raymond Hettinger f621232c0d Use funcdesc instead of classdesc to be consistent with out sections. 2002-12-31 17:24:50 +00:00
Fred Drake e2c649126e Further cleanup of exceptions. All interpolation-related exceptions
now derive from InterpolationError, which is not raised directly (only
subclasses get raised).  This matches what the docs already said.
2002-12-31 17:23:27 +00:00
Skip Montanaro 6c5bc3457c Bernhard Herzog's paragraph and string-filling code. I've been using it for
a month or two with great success.  Barry may want to tweak it some, but I
think it's a worthwhile enough addition to get some more people trying it
out.
2002-12-31 16:56:20 +00:00
Tony Lownds d8a6c5f4f4 Keep __main__ namespace clean 2002-12-31 16:52:44 +00:00
Just van Rossum 5e156add1f modulefinder.py moved to Lib/ 2002-12-31 16:38:01 +00:00
Raymond Hettinger 6222958500 Spelling fix 2002-12-31 16:37:03 +00:00
Guido van Rossum 768158c11b Fix an out-of-bound index in pmerge() discovered by Zooko (SF bug
645404).  I'm not 100% sure this is the right fix, so I'll keep the
bug report open for Samuele, but this fixes the index error and passes
the test suite (and I can't see why it *shouldn't* be the right fix
:-).
2002-12-31 16:33:01 +00:00
Just van Rossum e29310a2b3 patch attached to sf item #643711:
any_missing() returns less bogus missing modules.

- I've rewritten scan_code() more or less from scratch,
factored bits and pieces out for readability.
- keep track of global assignments and failed imports per
module; use this to determine whether the Y in "from X
import Y" is a submodule or just a global name. This is not
100% doable: you can't tell which symbols are imported when
doing a star import of a non-Python module short of actually
importing it.
- added a new method to ModuleFinder: any_missing_maybe(),
which returns *two* lists, one with certain misses, one with
possible misses. The possible misses are *very* often false
alarms, so it's useful to keep this list separate.
any_misses() now simply returns the union of
any_missing_maybe().

TODO: documentation, test_modulefinder.py
2002-12-31 16:33:00 +00:00
Raymond Hettinger cbd6cd2312 Add markup for time object.
Cleanup whitespace.
Fix unbalanced parenthesis.
2002-12-31 16:30:49 +00:00
Just van Rossum 41c554fbec moving modulefinder.py to the standard library 2002-12-31 16:27:33 +00:00
Neal Norwitz 6700e47b3c Fix compilation errors on HPUX11 2002-12-31 16:16:07 +00:00
Kurt B. Kaiser 6655e4bc27 Whitespace Normalization 2002-12-31 16:03:23 +00:00