1.5.2. The compiler generates code for the version of the interpreter
it is run under.
ast.py:
Print and Printnl add dest attr for extended print
new node AugAssign for augmented assignments
new nodes ListComp, ListCompFor, and ListCompIf for list
comprehensions
pyassem.py:
add work around for string-Unicode comparison raising UnicodeError
on comparison of two objects in code object's const table
pycodegen.py:
define VERSION, the Python major version number
get magic number using imp.get_magic() instead of hard coding
implement list comprehensions, extended print, and augmented
assignment; augmented assignment uses Delegator classes (see
doc string)
fix import and tuple unpacking for 1.5.2
transformer.py:
various changes to support new 2.0 grammar and old 1.5 grammar
add debug_tree helper than converts and symbol and token numbers
to their names
First, only report garbage that the GC cannot free. Second, only report
the number of objects found, not their repr(). People can dig deeper on
their own if they find a leak.
- don't close the fp, since that appears to also close the socket
- join the original url with the redirect reponse to deal with
relative redirect URL
wrap two socket ops in try/except to turn them into URLErrors, so that
client code need only catch one exception.
in HTTPError.__del__ only close fp if fp is not None
style changes:
- use f(*args) instead of apply(f, args)
- use __super_init instead of super.__init__(self, ...)
Let's hope this is correct (I'm not sure why the sys.platform would be
'Darwin1.2' rather than 'darwin1', which seems to be the convention).
Someone with Darwin please test this!
libm result is 0). Cautiously add a few libm exception test cases:
1. That exp(-huge) returns 0 without exception.
2. That exp(+huge) triggers OverflowError.
3. That sqrt(-1) raises ValueError specifically (apparently under glibc linked
with -lieee, it was raising OverflowError due to an accident of the way
mathmodule.c's CHECK() macro happened to deal with Infs and NaNs under gcc).
support for extension types, not classes.
pickle(): If the type is a class or if the reduction function is not
callable, raise a TypeError.
constructor(): If the constructor is not callable, raise TypeError.
This (partially) closes SourceForge patch #101859.
didn't bother to close the files. This caused the new test_wave test to fail
under Windows, as Windows won't let you delete a file that's open. Fixed
that by ensuring the wave read & write classes' .close() and __del__ methods
close files that were opened by their constructors.
driver code, so that each test gets this; it had been done inconsistently.
Remove the lines that set the variables holding dom objects to None; not
needed since the interpreter cleans up locals on function return.
Lownds. (#101816)
[Note: I'm not sure that this is really the right fix. Surely Darwin
doesn't require you to say "python.exe" everywhere??? Even Windows
doesn't! Or am I misunderstanding the point?]
tokenize.py has always used naive regexps for matching string literals,
and that appears to trigger the sre recursion limit on Skip's platform (he
has very long single-line string literals). Replaced all of tokenize.py's
string regexps with the "unrolled" forms used in IDLE, where they're known to
handle even absurd (multi-megabyte!) string literals without trouble. See
Friedl's book for explanation (at heart, the naive regexps create a backtracking
choice point for each character in the literal, while the unrolled forms create
none).
correct order of constructor args in createAttributeNS
pulldom: use symbolic names for uri and localnames
correct usage of createAttribute and setAttributeNode signatures.
callers of feed will get a SAXException.
In close, feed the last chunk first before calling endDocument, so that
the parser may report errors before the end of the document. Don't do
anything in a nested parser.
Don't call endDocument in parse; that will be called in close.
Use self._source for finding the SystemID; XML_GetBase will be cleared in
case of an error.
read the header from the .au file and do a sanity check
pass only the data to the audio device
call flush() so that program does not exit until playback is complete
call all the other methods to verify that they work minimally
call setparameters with a bunch of bugs arguments
linuxaudiodev.c:
use explicit O_WRONLY and O_RDONLY instead of 1 and 0
add a string name to each of the entries in audio_types[]
add AFMT_A_LAW to the list of known formats
add x_mode attribute to lad object, stores imode from open call
test ioctl return value as == -1, not < 0
in read() method, resize string before return
add getptr() method, that calls does ioctl on GETIPTR or GETOPTR
depending on x_mode
in setparameters() method, do better error checking and raise
ValueErrors; also use ioctl calls recommended by Open Sound
System Programmer's Guido (www.opensound.com)
use PyModule_AddXXX to define names in module
as a parameter; this was the only use of the base
constructor or surgical alteration of another object's
data attribute.
This change simplifies the constructor requirements for subclasses.
This relates to SourceForge bug #115928.
Script to regenerate platform-specific modules of constants.
[I moved common paths to variables for easier reading by humans. -- FLD]
This closes SourceForge patch #101781.
raise ValueError. Checked in the patch as far as it went, but also changed
all of ints, longs and floats to raise ZeroDivisionError instead when raising
0 to a negative number. This is what 754-inspired stds require, as the "true
result" is an infinity obtained from finite operands, i.e. it's a singularity.
Also changed float pow to not be so timid about using its square-and-multiply
algorithm. Note that what math.pow does is unrelated to what builtin pow
does, and will still vary by platform.
1. repr(license) will no longer print to stdout and read from stdin;
you have to use license(). `license` is a short message explaining
this.
2. Use lazy initialization so that startup isn't slowed down by the
search for the LICENSE file.
3. repr(license) actually returns the desired string, rather than
printing to stdout and returning ''. (Why didn't we think of this
before?)
4. Use the pythonlabs license URL as the license fallback instead of
the CNRI license handle.
apparently not considered a terminal, and so isatty(3) returns false. So we
skip the test for ttyness of the master side and just check the slave side,
which should really be a terminal.
CGI scripts should *not* use /usr/bin/env, since on systems that don't
come standard with Python installed, Python isn't on the default $PATH.
Too bad that this breaks on Linux, where Python is in /usr/bin which
is on the default path -- the point is that you must manually edit
your CGI scripts when you install them.
about how it would be nice to write absolute paths to the temporary
byte-compilation script, but this doesn't work because it screws up the
trailing-slash trickery done to 'prefix' in build_py's 'byte_compile()'
method.
Fixed to use 'execute()' instead of 'os.remove()' to remove the temporary
script: now it doesn't blow up in dry-run mode!
invalid proxy setting.
Minor change to call of unknown_url; always pass data argument
explicitly since data defaults to None.
PEP 42: Add as a feature that urllib handle proxy setting that contain
only the host and port of the proxy.
Linux distributions which provide both KDE and Gnome set this environment
variable even if the user is not using KDE. We do *not* want to start
Konquerer if KDE is not running unless the user actually tells us to!
by default (since compiling at install time works just fine). Details:
- added 'compile' and 'optimize' options
- added 'byte_compile()' method
- changed 'get_outputs()' so it includes bytecode files
A lot of the code added is very similar to code in install_lib.py;
would be nice to factor it out further.
choice between (compile, no-compile) * (optimize=0, optimize=1,
optimize=2). Details:
- added --no-compile option to complement --compile, which has
been there for ages
- changed --optimize (which never worked) to a value option, which
expects 0, 1, or 2
- renamed 'bytecompile()' method to 'byte_compile()', and beefed
it up to handle both 'compile' and 'optimize' options
- fix '_bytecode_filenames()' to respect the new options
standard 'py_compile.compile()' function. Laundry list of features:
- handles standard Distutils 'force', 'verbose', 'dry_run' flags
- handles various levels of optimization: can compile directly in
this interpreter process, or write a temporary script that is
then executed by a new interpreter with the appropriate flags
- can rewrite the source filename by stripping an optional prefix
and preprending an optional base dir.