| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
A surprising number of changes to split tp_new into tp_new and tp_init.
Turned out the older PyFile_FromFile() didn't initialize the memory it
allocated in all (error) cases, which caused new sanity asserts
elsewhere to fail left & right (and could have, e.g., caused file_dealloc
to try decrefing random addresses).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
keys are true strings -- no subclasses need apply. This may be debatable.
The problem is that a str subclass may very well want to override __eq__
and/or __hash__ (see the new example of case-insensitive strings in
test_descr), but go-fast shortcuts for strings are ubiquitous in our dicts
(and subclass overrides aren't even looked for then). Another go-fast
reason for the change is that PyCheck_StringExact() is a quicker test
than PyCheck_String(), and we make such a test on virtually every access
to every dict.
OTOH, a str subclass may also be perfectly happy using the base str eq
and hash, and this change slows them a lot. But those cases are still
hypothetical, while Python's own reliance on true-string dicts is not.
|
|
|
|
|
| |
builtin function); Guido pointed out that it could be just another
name in the __builtin__ dict for the file constructor now.
|
| |
|
|
|
|
|
|
| |
just by doing type(f) where f is any file object. This left a hole in
restricted execution mode that rexec.py can't plug by itself (although it
can plug part of it; the rest is plugged in fileobject.c now).
|
| |
|
| |
|
|
|
|
|
|
| |
on to the tp_new slot (if non-NULL), as well as to the tp_init slot (if
any). A sane type implementing both tp_new and tp_init should probably
pay attention to the arguments in only one of them.
|
|
|
|
| |
OverflowError message seems reasonable.
|
|
|
|
|
|
| |
and trace functions; this now declares that None will be passed for the
"call" event.
This closes SF bug/suggestion #460315.
|
| |
|
|
|
|
| |
Preliminary support. What's here works, but needs fine-tuning.
|
|
|
|
|
|
|
| |
Andrew quite correctly notices that the next() method isn't quite what
we need, since it returns None upon end instead of raising
StopIteration. His fix is easy enough, using iter(self.next, None)
instead.
|
| |
|
|
|
|
| |
because they don't work yet.
|
|
|
|
|
|
|
|
|
| |
backwards compatibility. When using the class of the first base as
the metaclass, use its __class__ attribute in preference over its
ob_type slot. This ensures that we can still use classic classes as
metaclasse, as shown in the original "Metaclasses" essay. This also
makes all the examples in Demo/metaclasses/ work again (maybe these
should be turned into a test suite?).
|
|
|
|
|
| |
Inhibited complex unary plus optimization when applied to a complex subtype.
Added PyComplex_CheckExact macro. Some comments and minor code fiddling.
|
|
|
|
|
|
|
| |
its normally chatty nature.
(This completes a side project to make "make -s" truly silent unless
errors occur.)
|
|
|
|
|
|
| |
with the same value instead. This ensures that a string (or string
subclass) object's ob_sinterned pointer is always a str (or NULL), and
that the dict of interned strings only has strs as keys.
|
|
|
|
|
|
|
|
| |
+ These were leaving the hash fields at 0, which all string and unicode
routines believe is a legitimate hash code. As a result, hash() applied
to str and unicode subclass instances always returned 0, which in turn
confused dict operations, etc.
+ Changed local names "new"; no point to antagonizing C++ compilers.
|
| |
|
|
|
|
|
|
|
|
|
| |
subclasses, all "the usual" ones (slicing etc), plus replace, translate,
ljust, rjust, center and strip. I don't know how to be sure they've all
been caught.
Question: Should we complain if someone tries to intern an instance of
a string subclass? I hate to slow any code on those paths.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
optimization (+F(whatever)).
|
|
|
|
|
| |
I(0) << whatever, I(0) >> whatever, I(whatever) << 0 and I(whatever) >> 0
optimizations.
|
|
|
|
|
|
| |
Added a few new toolbox modules.
Noted machine dependencies for some modules.
Moved waste to undoc.tex.
|
|
|
|
|
| |
Moved icopen to its alphabetical place.
Moved waste here (from toolbox).
|
|
|
|
| |
OSX MachO Python).
|
| |
|
|
|
|
|
| |
child processes is to use the Popen3 and Popen4 classes.
This fixes SF bug #460512.
|
|
|
|
| |
Disable t[:], t*0, t*1 optimizations when t is of a tuple subclass type.
|
| |
|
| |
|
|
|
|
|
| |
contributed by Gerhard Häring.
This is part of SF patch #460112.
|
|
|
|
| |
This is part of SF patch #460112.
|
| |
|
|
|
|
|
| |
cgi.FieldStorage class.
This closes SF patch #453691.
|
|
|
|
| |
calls to PyXXX_CheckExact(X).
|
|
|
|
|
|
|
|
| |
#460112 by Gerhard Haering.
(With slight layout changes to conform to docstrings guidelines and to
prevent a line longer than 78 characters. Also fixed some docstrings
that Gerhard didn't touch.)
|
| |
|
|
|
|
| |
#460112).
|
| |
|
| |
|
|
|
|
| |
This closes SF patch #459441.
|
|
|
|
| |
Older make's can apparently choke on this.
|
|
|
|
| |
time use .replace() to change all \r\n into \n, not just the last one.
|
|
|
|
|
|
| |
XXX'ed out. Turns out that after fixing the constructors, the
comparisons in fact succeed. E.g. int(hexint(12345)) returns an int
with value 12345.
|