summaryrefslogtreecommitdiffstats
path: root/Objects
Commit message (Collapse)AuthorAgeFilesLines
* Patch #1434038: property() now uses the getter's docstring if there isGeorg Brandl2006-03-081-0/+12
| | | | | no "doc" argument given. This makes it possible to legitimately use property() as a decorator to produce a read-only property.
* Checking in the code for PEP 357.Guido van Rossum2006-03-079-68/+180
| | | | | | This was mostly written by Travis Oliphant. I've inspected it all; Neal Norwitz and MvL have also looked at it (in an earlier incarnation).
* SF #1444030: Fix several potential defects found by Coverity.Hye-Shik Chang2006-03-074-11/+30
| | | | (reviewed by Neal Norwitz)
* Change int to Py_ssize_t in several places.Martin v. Löwis2006-03-075-10/+19
| | | | | Add (int) casts to silence compiler warnings. Raise Python exceptions for overflows.
* Oops, forgot to include this in the last checkin.Neal Norwitz2006-03-041-1/+1
| | | | Actually define Py_RefTotal as a Py_ssize_t.
* Change some sequnce APIs to use Py_ssize_t.Neal Norwitz2006-03-041-5/+9
|
* Use Py_ssize_t for PySet_Size() like all the other Py*_Size() functions.Neal Norwitz2006-03-041-1/+1
|
* Use %ld and casts to long for refcount printing, in absense of a universallyThomas Wouters2006-03-013-12/+31
| | | | | available %zd format character. Mark with an XXX comment so we can fix this, later.
* PEP 352 implementation. Creates a new base class, BaseException, which has anBrett Cannon2006-03-011-3/+3
| | | | | | | | | added message attribute compared to the previous version of Exception. It is also a new-style class, making all exceptions now new-style. KeyboardInterrupt and SystemExit inherit from BaseException directly. String exceptions now raise DeprecationWarning. Applies patch 1104669, and closes bugs 1012952 and 518846.
* Updates to the with-statement:Guido van Rossum2006-02-281-3/+37
| | | | | | | | | | | | | | | | - New semantics for __exit__() -- it must re-raise the exception if type is not None; the with-statement itself doesn't do this. (See the updated PEP for motivation.) - Added context managers to: - file - thread.LockType - threading.{Lock,RLock,Condition,Semaphore,BoundedSemaphore} - decimal.Context - Added contextlib.py, which defines @contextmanager, nested(), closing(). - Unit tests all around; bot no docs yet.
* Revert backwards-incompatible const changes.Martin v. Löwis2006-02-2720-23/+23
|
* Oops. Fix syntax for C89 compilers.Guido van Rossum2006-02-251-2/+2
|
* - Patch 1433928:Guido van Rossum2006-02-251-1/+15
| | | | | | | | - The copy module now "copies" function objects (as atomic objects). - dict.__getitem__ now looks for a __missing__ hook before raising KeyError. - Added a new type, defaultdict, to the collections module. This uses the new __missing__ hook behavior added to dict (see above).
* RFE #1436243: make integers in [0..256] preallocated.Georg Brandl2006-02-221-1/+1
|
* Make staticmethod and classmethod complain about keyword args.Georg Brandl2006-02-211-0/+4
|
* Bug #1086854: Rename PyHeapType members adding ht_ prefix.Georg Brandl2006-02-201-9/+9
|
* Remove size constraints in SLICE opcodes.Martin v. Löwis2006-02-171-3/+3
|
* Use proper PyArg_Parse format char for Py_ssize_t, instead of 'l', inThomas Wouters2006-02-161-1/+1
| | | | | buffer_new(). Probably fixes a bug in 'buffer("", 10, 10)' on platforms where sizeof(Py_ssize_t) != sizeof(long) (Win64?)
* Use correct PyArg_Parse format char for Py_ssize_t in unicode.center().Thomas Wouters2006-02-161-1/+1
| | | | | | | | | | | Fixes: >>> u"".center(10) Traceback (most recent call last): File "<stdin>", line 1, in <module> MemoryError on 64-bit systems.
* Use Py_ssize_t in helper function between Py_ssize_t-using functions.Thomas Wouters2006-02-161-2/+2
|
* Use Py_ssize_t for counts and sizes.Martin v. Löwis2006-02-1610-31/+33
| | | | Convert Py_ssize_t using PyInt_FromSsize_t
* Oops, this is supposed to be disabled by default.Neal Norwitz2006-02-161-1/+1
|
* Revert 42400.Martin v. Löwis2006-02-165-11/+11
|
* Support %zd in PyErr_Format and PyString_FromFormat.Martin v. Löwis2006-02-168-19/+35
|
* Get rid of compiler warnings (gcc 3.3.4 on x86)Neal Norwitz2006-02-165-11/+11
|
* doubletounicode(), longtounicode():Tim Peters2006-02-161-4/+8
| | | | | | | | Py_SAFE_DOWNCAST can evaluate its first argument multiple times in a debug build. This caused two distinct assert- failures in test_unicode run under a debug build. Rewrote the code in trivial ways so that multiple evaluation of the first argument doesn't hurt.
* Remove two unused Py_ssize_t variables (merge glitches, looks like.)Thomas Wouters2006-02-151-2/+0
|
* Avoid unused variables when SIZEOF_SIZE_T == SIZEOF_LONG. Also normalizeThomas Wouters2006-02-151-1/+3
| | | | whitespace.
* Merge ssize_t branch.Martin v. Löwis2006-02-1529-1022/+1205
|
* * Refcount leak. It was just a reference to Py_None, but still.Armin Rigo2006-02-141-3/+9
| | | | | | | * Allow the 3rd argument to generator.throw() to be None. The 'raise' statement does the same, and anyway it follows the general policy that optional arguments of built-ins should, when reasonable, have a default value specifiable from Python.
* SF patch #1397960: When mixing file-iteration andThomas Wouters2006-02-121-2/+39
| | | | | | | readline/readlines/read/readinto, loudly break by raising ValueError, rather than silently deliver data out of order or hitting EOF prematurely. Probably not a bugfix candidate, even though it affects no 'working' code.
* Renamed _length_cue() to __length_hint__(). See:Armin Rigo2006-02-118-18/+18
| | | | http://mail.python.org/pipermail/python-dev/2006-February/060524.html
* As discussed on python-dev, silence three gcc-4.0.x warnings, using assert()Thomas Wouters2006-02-011-2/+9
| | | | | | | | | | | to protect against actual uninitialized usage. Objects/longobject.c: In function ‘PyLong_AsDouble’: Objects/longobject.c:655: warning: ‘e’ may be used uninitialized in this function Objects/longobject.c: In function ‘long_true_divide’: Objects/longobject.c:2263: warning: ‘aexp’ may be used uninitialized in this function Objects/longobject.c:2263: warning: ‘bexp’ may be used uninitialized in this function
* Fix SF #1412837, compile failed with Watcom compilerNeal Norwitz2006-01-241-5/+5
|
* - Patch #1400181, fix unicode string formatting to not use the locale.Neal Norwitz2006-01-101-16/+21
| | | | | | | | | | | | | | | | This is how string objects work. u'%f' could use , instead of . for the decimal point. Now both strings and unicode always use periods. This is the code that would break: import locale locale.setlocale(locale.LC_NUMERIC, 'de_DE') u'%.1f' % 1.0 assert '1.0' == u'%.1f' % 1.0 I couldn't create a test case which fails, but this fixes the problem. Will backport.
* Remove some shadowed variablesNeal Norwitz2006-01-083-4/+4
|
* strlen() returns a size_t, get rid of 64-bit warningNeal Norwitz2006-01-081-1/+1
|
* Fix icc warnings: remove (sometimes) unused variable conditionallyNeal Norwitz2006-01-081-2/+4
|
* Fix icc warnings: remove unused variableNeal Norwitz2006-01-081-2/+1
|
* Stop maintaining the buildno file.Martin v. Löwis2006-01-051-12/+15
| | | | Also, stop determining Unicode sizes with PyString_GET_SIZE.
* Fix ref/memory leak introduced in rev 41845.Neal Norwitz2006-01-021-0/+2
|
* Fixed English in a comment; trimmed trailing whitespace;Tim Peters2006-01-011-11/+11
| | | | no code changes.
* SF bug #1153075: "PyXxx_Check(x) trusts x->ob_type->tp_mro".Armin Rigo2005-12-291-0/+33
| | | | | A patch by mwh to check that user-defined mro's are reasonable enough.
* SF patch #1390657:Armin Rigo2005-12-292-22/+60
| | | | | | | | | | | | | | | | | * set sq_repeat and sq_concat to NULL for user-defined new-style classes, as a way to fix a number of related problems. See test_descr.notimplemented()). One of these problems was fixed in r25556 and r25557 but many more existed; this is a general fix and thus reverts r25556-r25557. * to avoid having PySequence_Repeat()/PySequence_Concat() failing on user-defined classes, they now fall back to nb_add/nb_mul if sq_concat/sq_repeat are not defined and the arguments appear to be sequences. * added tests. Backport candidate.
* Check return result for errorNeal Norwitz2005-12-181-0/+2
|
* Bug #1379994: Fix *unicode_escape codecs to encode r'\' as r'\\'Hye-Shik Chang2005-12-171-3/+3
| | | | just like string codecs.
* Revert r41662 and the part of 41552 that originally caused the problemNeal Norwitz2005-12-151-7/+0
| | | | | (calling ftell(stdin) doesn't seem defined). So we won't test errors from ftell unless we can do it portably.
* Add a workaround for file.ftell() to raise IOError for ttys.Hye-Shik Chang2005-12-131-0/+7
| | | | | ftell(3) on BSD doesn't set errno even for ttys and returns useless values.
* en_sit will be freed when en is DECREF'd. Don't double free.Neal Norwitz2005-12-111-1/+0
|
* Add const to several API functions that take char *.Jeremy Hylton2005-12-1020-39/+45
| | | | | | | | | | | | | | | | | | | In C++, it's an error to pass a string literal to a char* function without a const_cast(). Rather than require every C++ extension module to put a cast around string literals, fix the API to state the const-ness. I focused on parts of the API where people usually pass literals: PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type slots, etc. Predictably, there were a large set of functions that needed to be fixed as a result of these changes. The most pervasive change was to make the keyword args list passed to PyArg_ParseTupleAndKewords() to be a const char *kwlist[]. One cast was required as a result of the changes: A type object mallocs the memory for its tp_doc slot and later frees it. PyTypeObject says that tp_doc is const char *; but if the type was created by type_new(), we know it is safe to cast to char *.