summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Make weak references subclassable:Fred Drake2004-07-022-68/+183
| | | | | | | | | | | | | | | | | | | | | | - weakref.ref and weakref.ReferenceType will become aliases for each other - weakref.ref will be a modern, new-style class with proper __new__ and __init__ methods - weakref.WeakValueDictionary will have a lighter memory footprint, using a new weakref.ref subclass to associate the key with the value, allowing us to have only a single object of overhead for each dictionary entry (currently, there are 3 objects of overhead per entry: a weakref to the value, a weakref to the dictionary, and a function object used as a weakref callback; the weakref to the dictionary could be avoided without this change) - a new macro, PyWeakref_CheckRefExact(), will be added - PyWeakref_CheckRef() will check for subclasses of weakref.ref This closes SF patch #983019.
* SF Bug #215126: Over restricted type checking on eval() functionRaymond Hettinger2004-07-022-7/+10
| | | | | | The builtin eval() function now accepts any mapping for the locals argument. Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing down the normal case. My timings so no measurable impact.
* sizeof(char) is 1, by definition, so get rid of that expression inTim Peters2004-06-271-12/+7
| | | | places it's just noise.
* Patch #966493: Cleanup generator/eval_frame exposure.Martin v. Löwis2004-06-271-1/+1
|
* SF bug #980419: int left-shift causes memory leakRaymond Hettinger2004-06-261-4/+26
|
* Cosmetic spacing fix.Raymond Hettinger2004-06-251-1/+1
|
* Fix leak found by Eric Huss.Raymond Hettinger2004-06-251-1/+6
|
* Disabling end-of-loop code not reached warning on SunProNicholas Bastin2004-06-181-0/+4
|
* Fixed end-of-loop code not reached warning when using SunPro CNicholas Bastin2004-06-173-0/+12
|
* Remove a function no longer in use.Raymond Hettinger2004-06-141-8/+0
|
* Remove unnecessary GC support. Sets cannot have cycles.Raymond Hettinger2004-06-131-16/+7
|
* * Factor out PyObject_SelfIter().Raymond Hettinger2004-06-121-9/+3
| | | | * Change a XDECREF to DECREF (adding an assertion just to be sure).
* Fix for bug #966623 - classes created with type() in an exec(, {}) don'tAnthony Baxter2004-06-111-0/+4
| | | | | | have a __module__. Test for this case. Bugfix candidate, will backport.
* dump HAVE_FOPENRF stuff - obsoleteSkip Montanaro2004-06-111-26/+19
|
* Futher improvements to frozenset hashing (based on Yitz Gale's battery ofRaymond Hettinger2004-06-101-8/+10
| | | | | | | | | | | | | tests which nicely highly highlight weaknesses). * Initial value is now a large prime. * Pre-multiply by the set length to add one more basis of differentiation. * Work a bit harder inside the loop to scatter bits from sources that may have closely spaced hash values. All of this is necessary to make up for keep the hash function commutative. Fortunately, the hash value is cached so the call to frozenset_hash() will only occur once per set.
* Fixups to the hash function for frozensets.Raymond Hettinger2004-06-101-1/+4
| | | | | | * Non-zero initial value so that hash(frozenset()) != hash(0). * Final permutation to differentiate nested sets. * Add logic to make sure that -1 is not a possible hash value.
* Add a final permutation step to the tuple hash function.Raymond Hettinger2004-06-101-0/+1
| | | | | Prevents a collision pattern that occurs with nested tuples. (Yitz Gale provided code that repeatably demonstrated the weakness.)
* Patch #774665: Make Python LC_NUMERIC agnostic.Martin v. Löwis2004-06-083-13/+20
|
* whoops, I wanted that commented out by default, will add doc to MiscNeal Norwitz2004-06-061-1/+1
|
* SF bug 881641, make it easier to use valgrindNeal Norwitz2004-06-061-4/+39
|
* Reword messageAndrew M. Kuchling2004-06-051-1/+1
|
* Fix exception wordingAndrew M. Kuchling2004-06-051-1/+1
|
* Replaced arbitrary addend in tuple_hash with one that is known to generateRaymond Hettinger2004-06-041-1/+9
| | | | many more prime multipliers and that performs well on collision tests.
* - SF #962502: Add two more methods for unicode type; width() andHye-Shik Chang2004-06-023-425/+563
| | | | | | | iswide() for east asian width manipulation. (Inspired by David Goodger, Reviewed by Martin v. Loewis) - Move _PyUnicode_TypeRecord.flags to the end of the struct so that no padding is added for UCS-4 builds. (Suggested by Martin v. Loewis)
* Patch #957398: Add public API for Generator Object/Type.Martin v. Löwis2004-06-011-0/+129
|
* SF bug #942952: Weakness in tuple hashRaymond Hettinger2004-06-011-2/+3
| | | | | | | (Basic approach and test concept by Tim Peters.) * Improved the hash to reduce collisions. * Added the torture test to the test suite.
* Add weakref support to array.array and file objects.Raymond Hettinger2004-05-311-2/+5
|
* Make sets and deques weak referencable.Raymond Hettinger2004-05-301-4/+8
|
* Update docstring for dict.update() to match the new realities.Walter Dörwald2004-05-281-1/+2
|
* Remove float_compare as perMichael W. Hudson2004-05-261-9/+1
| | | | | | [ 899109 ] 1==float('nan') which can now finally be closed, I think.
* SF bug #952866: "can't multiply sequence *by* non-int"Raymond Hettinger2004-05-121-1/+1
| | | | Minor wording fix.
* Nits:Raymond Hettinger2004-05-051-16/+9
| | | | | | | - Neatened the braces in PyList_New(). - Made sure "indexerr" was initialized to NULL. - Factored if blocks in PyList_Append(). - Made sure "allocated" is initialized in list_init().
* SF patch #947476: Apply freelist technique to listsRaymond Hettinger2004-05-051-4/+17
| | | | | Re-use list object bodies. Saves calls to malloc() and free() for faster list instantiation and deallocation.
* Two new public API functions, Py_IncRef and Py_DecRef. Useful forThomas Heller2004-04-221-0/+12
| | | | dynamic embedders of Python.
* * Add unittests for iterators that report their lengthRaymond Hettinger2004-04-123-10/+29
| | | | | | * Document the differences between them * Fix corner cases covered by the unittests * Use Py_RETURN_NONE where possible for dictionaries
* Use Py_RETURN_NONE macro where applicable.Raymond Hettinger2004-04-121-14/+8
|
* Small refactoring saving one function() and eliminating some indirection.Raymond Hettinger2004-04-121-11/+10
| | | | | * Applied app1() to listappend(). * Inlined ins() into its one remaining caller.
* * Specialize ins1() into app1() for appends. Saves several unnecessaryRaymond Hettinger2004-04-121-6/+36
| | | | | | steps and further improves the speed of list append. * Add guards to the list iterator length method to handle corner cases.
* SF Patch #926375: Remove a useless UTF-16 support code that is neverHye-Shik Chang2004-04-061-18/+3
| | | | been used. (Suggested by Martin v. Loewis)
* Improve previous checkin to use a slot check instead of equivalentRaymond Hettinger2004-04-051-1/+2
| | | | attribute name lookup.
* Improve accuracy of sequence and mapping checks.Raymond Hettinger2004-04-041-2/+8
|
* If a file is opened with an explicit buffer size >= 1, repeatedAndrew MacIntyre2004-04-041-0/+2
| | | | | | | | close() calls would attempt to free() the buffer already free()ed on the first close(). [bug introduced with patch #788249] Making sure that the buffer is free()ed in file object deallocation is a belt-n-braces bit of insurance against a memory leak.
* Get rid of gcc warning.Hye-Shik Chang2004-03-251-1/+2
|
* Correct code to advance ptr to be well-formed C.Martin v. Löwis2004-03-251-1/+1
|
* Ensure super() lookup of descriptor from classmethod works (SF #743627)Phillip J. Eby2004-03-251-1/+8
|
* Intern __name__.Martin v. Löwis2004-03-231-1/+9
|
* Restored revision 2.87.Armin Rigo2004-03-211-12/+5
|
* PyTuple_New(): vrbl i no longer referenced, so removed it (which killsTim Peters2004-03-211-1/+1
| | | | off a new compiler wng under MSVC6).
* This is the fastest I could get on Intel GCC. I kept the memset() in to clearArmin Rigo2004-03-211-4/+11
| | | | | | | | the newly created tuples, but tuples added in the freelist are now cleared in tupledealloc already (which is very cheap, because we are already Py_XDECREF'ing all elements anyway). Python should have a standard Py_ZAP macro like ZAP in pystate.c.
* Changed file.name to be the object passed as the 'name' argument to file()Nicholas Bastin2004-03-211-17/+21
| | | | Fixes SF Bug #773356