- 04 Eki, 2001 9 kayıt (commit)
-
-
Guido van Rossum yazdı
-
Tim Peters yazdı
-
Tim Peters yazdı
-
Tim Peters yazdı
normalization. Now uses \t in strings instead of hard tabs.
-
Tim Peters yazdı
classes (sheesh!).
-
Tim Peters yazdı
-
Tim Peters yazdı
-
Tim Peters yazdı
For a dynamically constructed type object, fill in the tp_doc slot with a copy of the argument dict's "__doc__" value, provided the latter exists and is a string. NOTE: I don't know what to do if it's a Unicode string, so in that case tp_doc is left NULL (which shows up as Py_None if you do Class.__doc__). Note that tp_doc holds a char*, not a general PyObject*.
-
Guido van Rossum yazdı
it deals correctly with some anomalous cases; according to this test suite I've fixed it right. The anomalous cases had to do with 'exception' events: these aren't generated when they would be most helpful, and the profiler has to work hard to recover the right information. The problems occur when C code (such as hasattr(), which is used as the example here) calls back into Python code and clears an exception raised by that Python code. Consider this example: def foo(): hasattr(obj, "bar") Where obj is an instance from a class like this: class C: def __getattr__(self, name): raise AttributeError The profiler sees the following sequence of events: call (foo) call (__getattr__) exception (in __getattr__) return (from foo) Previously, the profiler would assume the return event returned from __getattr__. An if statement checking for this condition and raising an exception was commented out... This version does the right thing.
-
- 03 Eki, 2001 13 kayıt (commit)
-
-
Fred Drake yazdı
This reflects what is currently in CVS, which may change before 2.2 is final.
-
Fred Drake yazdı
-
Fred Drake yazdı
-
Greg Ward yazdı
-
Andrew M. Kuchling yazdı
-
Guido van Rossum yazdı
test for modifying __getattr__ works, now that slot_tp_getattr_hook zaps the slot if there's no hook. Added an XXX comment with a ref back to slot_tp_getattr_hook.
-
Guido van Rossum yazdı
test for getattribute==NULL was bogus because it always found object.__getattribute__. Pick it apart using the trick we learned from slot_sq_item, and if it's just a wrapper around PyObject_GenericGetAttr, zap it. Also added a long XXX comment explaining the consequences.
-
Skip Montanaro yazdı
loss for no reason.
-
Guido van Rossum yazdı
test dramatically: class T(tuple): __dynamic__ = 1 t = T(range(1000)) for i in range(1000): tt = tuple(t) The speedup was about 5x compared to the previous state of CVS (1.7 vs. 8.8, in arbitrary time units). But it's still more than twice as slow as as the same test with __dynamic__ = 0 (0.8). I'm not sure that I really want to go through the trouble of this kind of speedup for every slot. Even doing it just for the most popular slots will be a major effort (the new slot_sq_item is 40+ lines, while the old one was one line with a powerful macro -- unfortunately the speedup comes from expanding the macro and doing things in a way specific to the slot signature). An alternative that I'm currently considering is sketched in PLAN.txt: trap setattr on type objects. But this will require keeping track of all derived types using weak references.
-
Tim Peters yazdı
-
Tim Peters yazdı
Taught doctest about static methods, class methods, and property docstrings in new-style classes. As for inspect.py/pydoc.py before it, the new stuff needed didn't really fit into the old architecture (but was less of a strain to force-fit here). New-style class docstrings still aren't found, but that's the subject of a different bug and I want to fix that right instead of hacking around it in doctest.
-
Guido van Rossum yazdı
Add more detail about the speed optimizations needed for __dynamic__. The weak reference solution becomes more attractive...
-
Guido van Rossum yazdı
pointing to a static variable to hold the object form of the string was never used, causing endless calls to PyString_InternFromString(). One particular test (with lots of __getitem__ calls) became a third faster with this!
-
- 02 Eki, 2001 12 kayıt (commit)
-
-
Guido van Rossum yazdı
-
Guido van Rossum yazdı
-
Tim Peters yazdı
Another installment; the new functionality wasn't actually enabled in normal use, only in the strained use checked by the test case.
-
Tim Peters yazdı
Unknown whether this fixes it. - stringobject.c, PyString_FromFormatV: don't assume that va_list is of a type that can be copied via an initializer. - errors.c, PyErr_Format: add a va_end() to balance the va_start().
-
Guido van Rossum yazdı
instances). Also added GC support to various auxiliary types: super, property, descriptors, wrappers, dictproxy. (Only type objects have a tp_clear field; the other types are.) One change was necessary to the GC infrastructure. We have statically allocated type objects that don't have a GC header (and can't easily be given one) and heap-allocated type objects that do have a GC header. Giving these different metatypes would be really ugly: I tried, and I had to modify pickle.py, cPickle.c, copy.py, add a new invent a new name for the new metatype and make it a built-in, change affected tests... In short, a mess. So instead, we add a new type slot tp_is_gc, which is a simple Boolean function that determines whether a particular instance has GC headers or not. This slot is only relevant for types that have the (new) GC flag bit set. If the tp_is_gc slot is NULL (by far the most common case), all instances of the type are deemed to have GC headers. This slot is called by the PyObject_IS_GC() macro (which is only used twice, both times in gcmodule.c). I also changed the extern declarations for a bunch of GC-related functions (_PyObject_GC_Del etc.): these always exist but objimpl.h only declared them when WITH_CYCLE_GC was defined, but I needed to be able to reference them without #ifdefs. (When WITH_CYCLE_GC is not defined, they do the same as their non-GC counterparts anyway.)
-
Tim Peters yazdı
Tim Hochberg. Doctest no longer searches imported objects.
-
Guido van Rossum yazdı
- The test for deepcopy() in pickles() was indented wrongly, so it got run twice (one for binary pickle mode, one for text pickle mode; but the test doesn't depend on the pickle mode). - In verbose mode, show which subtest (pickle/cPickle/deepcopy, text/bin).
-
Guido van Rossum yazdı
in run_test() referenced two non-existent variables, and in non-verbose mode, the tests didn't report the actual number, when it differed from the expected number. Fixed this. Also added an extra call to gc.collect() at the start of test_all(). This will be needed when I check in the changes to add GC to new-style classes.
-
Guido van Rossum yazdı
"from xml.parsers import expat" succeeds but the imported expat module is an empty shell. Make sure we don't be fooled by that.
-
Guido van Rossum yazdı
is not found). Being fancy: insert the first 3 characters of sys.version in the URL.
-
Guido van Rossum yazdı
-
Tim Peters yazdı
from Tim Hochberg. Also mucho fiddling to change the way doctest determines whether a thing is a function, module or class. Under 2.2, this really requires the functions in inspect.py (e.g., types.ClassType is close to meaningless now, if not outright misleading).
-
- 01 Eki, 2001 6 kayıt (commit)
-
-
Fred Drake yazdı
public interface, so we can simplify the documentation.
-
Tim Peters yazdı
-
Tim Peters yazdı
try to explain the complex general scheme we actually use now, I decided to spell out only what equality means (which is easy to explain and intuitive), leaving the other outcomes unspecified beyond consistency.
-
Tim Peters yazdı
The patch repaired internal gcc compiler errors on BeOS. This checkin repairs them in a simpler way, by explicitly casting the platform INFINITY to double.
-
Fredrik Lundh yazdı
added local escape method (made the dumps method some 50-80% faster) minor tweaks to the unmarshalling code
-
Tim Peters yazdı
Patch from Steve Scott to add SIGBREAK support (unique to Windows).
-