- 22 May, 2001 1 kayıt (commit)
-
-
Guido van Rossum yazdı
prototype, for gcc -Wstrict-prototypes.
-
- 11 May, 2001 1 kayıt (commit)
-
-
Jeremy Hylton yazdı
For rich comparisons, use instance_getattr2() when possible to avoid the expense of setting an AttributeError. Also intern the name_op[] table and use the interned strings rather than creating a new string and interning it each time through.
-
- 05 May, 2001 1 kayıt (commit)
-
-
Tim Peters yazdı
safely together and don't duplicate logic (the common logic was factored out into new private API function _PySequence_IterContains()). Visible change: some_complex_number in some_instance no longer blows up if some_instance has __getitem__ but neither __contains__ nor __iter__. test_iter changed to ensure that remains true.
-
- 03 May, 2001 1 kayıt (commit)
-
-
Fred Drake yazdı
need to be specified in the type structures independently. The flag exists only for binary compatibility. This is a "source cleanliness" issue and introduces no behavioral changes.
-
- 30 Nis, 2001 1 kayıt (commit)
-
-
Guido van Rossum yazdı
printing of instances not to look for __str__(). Fix this.
-
- 23 Nis, 2001 1 kayıt (commit)
-
-
Guido van Rossum yazdı
sees it (test_iter.py is unchanged). - Added a tp_iternext slot, which calls the iterator's next() method; this is much faster for built-in iterators over built-in types such as lists and dicts, speeding up pybench's ForLoop with about 25% compared to Python 2.1. (Now there's a good argument for iterators. ;-) - Renamed the built-in sequence iterator SeqIter, affecting the C API functions for it. (This frees up the PyIter prefix for generic iterator operations.) - Added PyIter_Check(obj), which checks that obj's type has a tp_iternext slot and that the proper feature flag is set. - Added PyIter_Next(obj) which calls the tp_iternext slot. It has a somewhat complex return condition due to the need for speed: when it returns NULL, it may not have set an exception condition, meaning the iterator is exhausted; when the exception StopIteration is set (or a derived exception class), it means the same thing; any other exception means some other error occurred.
-
- 20 Nis, 2001 1 kayıt (commit)
-
-
Guido van Rossum yazdı
new slot tp_iter in type object, plus new flag Py_TPFLAGS_HAVE_ITER new C API PyObject_GetIter(), calls tp_iter new builtin iter(), with two forms: iter(obj), and iter(function, sentinel) new internal object types iterobject and calliterobject new exception StopIteration new opcodes for "for" loops, GET_ITER and FOR_ITER (also supported by dis.py) new magic number for .pyc files new special method for instances: __iter__() returns an iterator iteration over dictionaries: "for x in dict" iterates over the keys iteration over files: "for x in file" iterates over lines TODO: documentation test suite decide whether to use a different way to spell iter(function, sentinal) decide whether "for key in dict" is a good idea use iterators in map/filter/reduce, min/max, and elsewhere (in/not in?) speed tuning (make next() a slot tp_next???)
-
- 23 Mar, 2001 1 kayıt (commit)
-
-
Fred Drake yazdı
-
- 22 Mar, 2001 1 kayıt (commit)
-
-
Fred Drake yazdı
must now initialize the extra field used by the weak-ref machinery to NULL themselves, to avoid having to require PyObject_INIT() to check if the type supports weak references and do it there. This causes less work to be done for all objects (the type object does not need to be consulted to check for the Py_TPFLAGS_HAVE_WEAKREFS bit).
-
- 26 Şub, 2001 2 kayıt (commit)
-
-
Fred Drake yazdı
so make it void.
-
Barry Warsaw yazdı
set a function attribute on a method (either bound or unbound). This reverts to Python 2.0 behavior that no attributes of the method are writable, but provides a more informative error message.
-
- 01 Şub, 2001 1 kayıt (commit)
-
-
Fred Drake yazdı
-
- 29 Ock, 2001 2 kayıt (commit)
-
-
Guido van Rossum yazdı
typedef, and at least one compiler choked on this. (SF patch #103457, by bquinlan)
-
Jeremy Hylton yazdı
-
- 28 Ock, 2001 1 kayıt (commit)
-
-
Fred Drake yazdı
-
- 18 Ock, 2001 1 kayıt (commit)
-
-
Guido van Rossum yazdı
__cmp__ and __eq__ absent before deciding to do a quickie based on the object address. (Tim Peters discovered this.)
-
- 17 Ock, 2001 2 kayıt (commit)
-
-
Guido van Rossum yazdı
earlier coercion changes, not by rich comparisons. When a coercion function returns 1 (meaning it cannot do it), it should not INCREF the arguments. When no __coerce__() method was found, instance_coerce() originally returned 0, pretending it did it. Neil changed the return value to 1, more accurately reflecting that it didn't do anything, but forgot to take out the two INCREF calls.
-
Guido van Rossum yazdı
- Got rid of instance_cmp(); refactored instance_compare(). - Added instance_richcompare() which calls __lt__() etc. Some unrelated stuff mixed in: - Aligned comments in various large struct initializers. - Better test to avoid recursion if __coerce__ returns self as the first argument (this is an unrelated fix by Neil Schemenauer!). - Style nit: don't use Py_DECREF(Py_NotImplemented); use Py_DECREF(result) -- it just looks better. :-)
-
- 15 Ock, 2001 1 kayıt (commit)
-
-
Barry Warsaw yazdı
Closes SF patch #103123. funcobject.h: PyFunctionObject: add the func_dict slot. funcobject.c: PyFunction_New(): Initialize the func_dict slot to NULL. func_getattr(): Rename to func_getattro() and change the signature. It's more efficient to use attro methods and dig the C string out than it is to re-convert a C string to a PyString. Also, add support for getting the __dict__ (a.k.a. func_dict) attribute, and for getting an arbitrary function attribute. func_setattr(): Rename to func_setattro() and change the signature for the same reason. Also add support for setting __dict__ (a.k.a. func_dict) and any arbitrary function attribute. func_dealloc(): Be sure to DECREF the func_dict slot. func_traverse(): Be sure to traverse func_dict too. PyFunction_Type: make the necessary func_?etattro() changes. classobject.c: instancemethod_memberlist: Add __dict__ instancemethod_setattro(): New method to set arbitrary attributes on methods (really the underlying im_func). Raise TypeError when the instance is bound or when you're trying to set one of the reserved im_* attributes. instancemethod_getattr(): Renamed to instancemethod_getattro() since that's what it really is. Also, added support fo getting arbitrary attributes through the im_func. PyMethod_Type: Do the ?etattr{,o} dance.
-
- 04 Ock, 2001 1 kayıt (commit)
-
-
Neil Schemenauer yazdı
types no longer get special treatment from abstract.c so more number number methods have to be implemented.
-
- 24 Eki, 2000 1 kayıt (commit)
-
-
Fred Drake yazdı
Changes to error messages to increase consistency & clarity. This (mostly) closes SourceForge patch #101839.
-
- 04 Eki, 2000 1 kayıt (commit)
-
-
Neil Schemenauer yazdı
-
- 17 Eyl, 2000 1 kayıt (commit)
-
-
Tim Peters yazdı
that Py_INCREF boosts global _Py_RefTotal when Py_REF_DEBUG is defined but Py_TRACE_REFS isn't. There are, IMO, way too many preprocessor gimmicks in use for refcount debugging (at least 3 distinct true/false symbols, but not all 8 combos are supported by the code, etc etc), and no coherent documentation of this stuff -- 'twas too painful to track this one down.
-
- 15 Eyl, 2000 1 kayıt (commit)
-
-
Neil Schemenauer yazdı
they are dead. Fixes bug #113812.
-
- 01 Eyl, 2000 2 kayıt (commit)
-
-
Guido van Rossum yazdı
This should match the situation in the 1.6b1 tree.
-
Jeremy Hylton yazdı
add sanity check to gc: if an exception occurs during GC, call PyErr_WriteUnraisable and then call Py_FatalEror.
-
- 25 Agu, 2000 1 kayıt (commit)
-
-
Thomas Wouters yazdı
-
- 24 Agu, 2000 1 kayıt (commit)
-
-
Thomas Wouters yazdı
the list object supports this currently, but other candidates are gladly accepted (like arraymodule and such.)
-
- 18 Agu, 2000 1 kayıt (commit)
-
-
Barry Warsaw yazdı
to integer types (i.e. Py_uintptr_t, our spelling of C9X's uintptr_t). ANSI specifies that pointer compares other than == and != to non-related structures are undefined. This quiets an Insure portability warning.
-
- 17 Agu, 2000 1 kayıt (commit)
-
-
Thomas Wouters yazdı
is no __getslice__ available. Also does the same for C extension types. Includes rudimentary documentation (it could use a cross reference to the section on slice objects, I couldn't figure out how to do that) and a test suite for all Python __hooks__ I could think of, including the new behaviour.
-
- 23 Tem, 2000 1 kayıt (commit)
-
-
Thomas Wouters yazdı
-
- 16 Tem, 2000 1 kayıt (commit)
-
-
Thomas Wouters yazdı
comments, docstrings or error messages. I fixed two minor things in test_winreg.py ("didn't" -> "Didn't" and "Didnt" -> "Didn't"). There is a minor style issue involved: Guido seems to have preferred English grammar (behaviour, honour) in a couple places. This patch changes that to American, which is the more prominent style in the source. I prefer English myself, so if English is preferred, I'd be happy to supply a patch myself ;)
-
- 09 Tem, 2000 2 kayıt (commit)
-
-
Fred Drake yazdı
-
Tim Peters yazdı
-
- 08 Tem, 2000 1 kayıt (commit)
-
-
Skip Montanaro yazdı
-
- 01 Tem, 2000 1 kayıt (commit)
-
-
Guido van Rossum yazdı
-
- 30 Haz, 2000 4 kayıt (commit)
-
-
Guido van Rossum yazdı
-
Guido van Rossum yazdı
-
Fred Drake yazdı
The common technique for printing out a pointer has been to cast to a long and use the "%lx" printf modifier. This is incorrect on Win64 where casting to a long truncates the pointer. The "%p" formatter should be used instead. The problem as stated by Tim: > Unfortunately, the C committee refused to define what %p conversion "looks > like" -- they explicitly allowed it to be implementation-defined. Older > versions of Microsoft C even stuck a colon in the middle of the address (in > the days of segment+offset addressing)! The result is that the hex value of a pointer will maybe/maybe not have a 0x prepended to it. Notes on the patch: There are two main classes of changes: - in the various repr() functions that print out pointers - debugging printf's in the various thread_*.h files (these are why the patch is large) Closes SourceForge patch #100505.
-
Jeremy Hylton yazdı
-