summaryrefslogtreecommitdiffstats
path: root/Include
Commit message (Collapse)AuthorAgeFilesLines
* Make the PyXXX_Check() macros for the numeric types inheritance-aware.Guido van Rossum2001-08-294-4/+4
|
* PyString_FromFormat() and PyString_FromFormatV(): Largely ripped fromBarry Warsaw2001-08-241-0/+4
| | | | | | | | | | | | | | | | | | | PyErr_Format() these new C API methods can be used instead of sprintf()'s into hardcoded char* buffers. This allows us to fix many situation where long package, module, or class names get truncated in reprs. PyString_FromFormat() is the varargs variety. PyString_FromFormatV() is the va_list variety Original PyErr_Format() code was modified to allow %p and %ld expansions. Many reprs were converted to this, checkins coming soo. Not changed: complex_repr(), float_repr(), float_print(), float_str(), int_repr(). There may be other candidates not yet converted. Closes patch #454743.
* Add decl of PySuper_Type; fixup comments for the two other types.Guido van Rossum2001-08-241-2/+3
|
* Add new built-in type 'getset' (PyGetSet_Type).Guido van Rossum2001-08-231-0/+3
| | | | This implements the 'getset' class from test_binop.py.
* Introduce OverflowWarning -- to be issued when short int operationsGuido van Rossum2001-08-231-0/+1
| | | | are overflowing and a long int operation is substituted.
* Merge changes from r22a2-branch back into trunk. Also, change patchBarry Warsaw2001-08-221-2/+2
| | | | level to 2.2a2+
* ceval, PyEval_MergeCompilerFlags: wasn't merging in theTim Peters2001-08-171-0/+2
| | | | | | | | | | | | | | CO_FUTURE_DIVISION flag. Redid this to use Jeremy's PyCF_MASK #define instead, so we dont have to remember to fiddle individual feature names here again. pythonrun.h: Also #define a PyCF_MASK_OBSOLETE mask. This isn't used yet, but will be as part of the PEP 264 implementation (compile() mustn't raise an error just because old code uses a flag name that's become obsolete; a warning may be appropriate, but not an error; so compile() has to know about obsolete flags too, but nobody is going to remember to update compile() with individual obsolete flag names across releases either -- i.e., this is the flip side of PyEval_MergeCompilerFlags's oversight).
* Patch #445762: Support --disable-unicodeMartin v. Löwis2001-08-174-0/+13
| | | | | | | | - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests.
* - Get rid of obsolete #define PATCHLEVEL.Guido van Rossum2001-08-171-4/+1
| | | | - Change PY_VERSION (but not the numeric versions) to "2.2a1+".
* Added comments before recently added/assigned slots in the type object,Fred Drake2001-08-151-0/+6
| | | | | so the backward compatibility issues will be easier to understand. I only added comments indicating additions and assignments back to Python 2.0.
* Remove much dead code from ceval.cJeremy Hylton2001-08-121-0/+5
| | | | | | | | | | | | | | The descr changes moved the dispatch for calling objects from call_object() in ceval.c to PyObject_Call() in abstract.c. call_object() and the many functions it used in ceval.c were no longer used, but were not removed. Rename meth_call() as PyCFunction_Call() so that it can be called by the CALL_FUNCTION opcode in ceval.c. Also, fix error message that referred to PyEval_EvalCodeEx() by its old name eval_code2(). (I'll probably refer to it by its old name, too.)
* Remove st_nested_scopes from struct symtable,Jeremy Hylton2001-08-111-1/+0
| | | | | | | because nested scopes are always enabled. (Accidentally checked in one small change along this path yesterday, wreaking havoc in the Windows build.)
* Refactor future feature handlingJeremy Hylton2001-08-102-16/+3
| | | | | | | | | | | | | | | | | | | Replace individual slots in PyFutureFeatures with a single bitmask with one field per feature. The flags for this bitmask are the same as the flags used in the co_flags slot of a code object. XXX This means we waste several bits, because they are used for co_flags but have no meaning for future statements. Don't think this is an issue. Remove the NESTED_SCOPES_DEFAULT define and others. Not sure what they were for anyway. Remove all the PyCF_xxx flags, but define PyCF_MASK in terms of the CO_xxx flags that are relevant for this release. Change definition of PyCompilerFlags so that cf_flags matches co_flags.
* Add PyDict_Merge(a, b, override):Guido van Rossum2001-08-101-0/+1
| | | | | | PyDict_Merge(a, b, 1) is the same as PyDict_Update(a, b). PyDict_Merge(a, b, 0) does something similar but leaves existing items unchanged.
* Add new flags for PyType_Ready(): READY to explicitly indicate theGuido van Rossum2001-08-101-0/+6
| | | | | | type is ready, and READYING to indicate that it is busy with the type. A recursive call is a fatal error.
* SF patch #438013 Remove 2-byte Py_UCS2 assumptionsTim Peters2001-08-091-6/+0
| | | | | | | | Removed all instances of Py_UCS2 from the codebase, and so also (I hope) the last remaining reliance on the platform having an integral type with exactly 16 bits. PyUnicode_DecodeUTF16() and PyUnicode_EncodeUTF16() now read and write one byte at a time.
* Remove 6-year old hack to worm around a bug in "NextSpec/Sparc 3.3Tim Peters2001-08-081-12/+0
| | | | pre-release limits.h".
* Split macglue.c into two: a new mactoolboxglue.c (in ./Python)Jack Jansen2001-08-081-0/+168
| | | | | | | | | | | | with functionality needed for both unix-Python and MacPython and a new smaller ./Mac/Python/macglue.c which contains MacPython stuff only. pymactoolbox.h has moved to ./Include from ./Mac/Include and now also contains the relevant stuff from macglue.h. The net effect of this is that the ./Mac subdirectory is not needed anymore for building the unix-Python core on MacOSX (it is needed for building the extension modules).
* Put conditional S_ISDIR definition(s) into pyport.h.Martin v. Löwis2001-08-081-0/+13
|
* Implement PEP 238 in its (almost) full glory.Guido van Rossum2001-08-086-4/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | This introduces: - A new operator // that means floor division (the kind of division where 1/2 is 0). - The "future division" statement ("from __future__ import division) which changes the meaning of the / operator to implement "true division" (where 1/2 is 0.5). - New overloadable operators __truediv__ and __floordiv__. - New slots in the PyNumberMethods struct for true and floor division, new abstract APIs for them, new opcodes, and so on. I emphasize that without the future division statement, the semantics of / will remain unchanged until Python 3.0. Not yet implemented are warnings (default off) when / is used with int or long arguments. This has been on display since 7/31 as SF patch #443474. Flames to /dev/null.
* - Rename PyType_InitDict() to PyType_Ready().Guido van Rossum2001-08-071-1/+1
| | | | | | - Add an explicit call to PyType_Ready(&PyList_Type) to pythonrun.c (just for the heck of it, really -- we should either explicitly ready all types, or none).
* Got rid of (hopefully) the last 68k-mac related ifdefs.Jack Jansen2001-08-071-62/+0
|
* Patch #448194: Debuging negative reference counts.Martin v. Löwis2001-08-051-5/+6
|
* Removed duplicate definnitions of PyObject_AS_GC and PyObject_FROM_GC ↵Jack Jansen2001-08-031-2/+0
| | | | (occurred only if GC was off).
* Merge of descr-branch back into trunk.Tim Peters2001-08-0214-20/+220
|
* Enable PyOS_snprintf() et al. during alpha phase of 2.2.0 andMarc-André Lemburg2001-07-311-0/+7
| | | | add another use case to the socketmodule.
* As discussed on python-dev: this patch adds name mangling toMarc-André Lemburg2001-07-311-0/+150
| | | | | assure that extensions and interpreters using the Unicode APIs were compiled using the same Unicode width.
* va_list is defined in stdarg.h.Marc-André Lemburg2001-07-311-0/+1
|
* This patch turns the Python API mismatch notice into a standardMarc-André Lemburg2001-07-311-0/+16
| | | | | | | | | | | | Python warning which can be catched by means of the Python warning framework. It also adds two new APIs which hopefully make it easier for Python to switch to buffer overflow safe [v]snprintf() APIs for error reporting et al. The two new APIs are PyOS_snprintf() and PyOS_vsnprintf() and work just like the standard ones in many C libs. On platforms which have snprintf(), the native APIs are used, on all other an emulation with snprintf() tries to do its best.
* Add _PyUnicode_AsDefaultEncodedString to unicodeobject.h.Jeremy Hylton2001-07-301-0/+17
| | | | | | | And remove all the extern decls in the middle of .c files. Apparently, it was excluded from the header file because it is intended for internal use by the interpreter. It's still intended for internal use and documented as such in the header file.
* Repair more now-obsolete references to config.h.Tim Peters2001-07-264-4/+4
|
* Patch #411138: Rename config.h to pyconfig.h. Closes bug #231774.Martin v. Löwis2001-07-263-3/+3
|
* Fix typo in comment.Neil Schemenauer2001-07-231-1/+1
|
* Add -E command line switch (ignore environment variables like PYTHONHOMENeil Schemenauer2001-07-231-0/+6
| | | | and PYTHONPATH).
* Add a low-level API to access interpreters, for David Beazley.Guido van Rossum2001-07-191-0/+7
| | | | SF patch #436376.
* Patch #412229: Add functions sys.getdlopenflags and sys.setdlopenflags.Martin v. Löwis2001-07-181-0/+3
| | | | Add dlopenflags to PyInterpreterState, and use it in dlopen calls.
* Ugly. A pile of new xxxFlags() functions, to communicate to the parserTim Peters2001-07-162-0/+11
| | | | | | | | | | | | | | | | | | | | | | | that 'yield' is a keyword. This doesn't help test_generators at all! I don't know why not. These things do work now (and didn't before this patch): 1. "from __future__ import generators" now works in a native shell. 2. Similarly "python -i xxx.py" now has generators enabled in the shell if xxx.py had them enabled. 3. This program (which was my doctest proxy) works fine: from __future__ import generators source = """\ def f(): yield 1 """ exec compile(source, "", "single") in globals() print type(f())
* Part way to allowing "from __future__ import generators" to communicateTim Peters2001-07-164-3/+20
| | | | | | | | | | that info to code dynamically compiled *by* code compiled with generators enabled. Doesn't yet work because there's still no way to tell the parser that "yield" is OK (unlike nested_scopes, the parser has its fingers in this too). Replaced PyEval_GetNestedScopes by a more-general PyEval_MergeCompilerFlags. Perhaps I should not have? I doubted it was *intended* to be part of the public API, so just did.
* Preliminary support for "from __future__ import generators" to enableGuido van Rossum2001-07-151-0/+3
| | | | | | | | the yield statement. I figure we have to have this in before I can release 2.2a1 on Wednesday. Note: test_generators is currently broken, I'm counting on Tim to fix this.
* Python.h: Don't attempt to redefine NDEBUG if it's already defined.Tim Peters2001-07-151-0/+2
| | | | Others: Remove redundant includes of assert.h.
* Define NDEBUG when Py_DEBUG undefined, to disable the assert macro.Guido van Rossum2001-07-151-0/+4
|
* Enable nested scopes by default.Guido van Rossum2001-07-121-1/+1
| | | | | | | | | | | Although this is a one-character change, more work needs to be done: the compiler can get rid of a lot of non-nested-scopes code, the documentation needs to be updated, the future statement can be simplified, etc. But this change enables the nested scope semantics everywhere, and that's the important part -- we can now test code for compatibility with nested scopes by default.
* Re-add 'advanced' xrange features, adding DeprecationWarnings as discussedThomas Wouters2001-07-091-1/+1
| | | | | on python-dev. The features will still vanish, however, just one release later.
* Rip out the fancy behaviors of xrange that nobody uses: repeat, slice,Guido van Rossum2001-07-051-1/+1
| | | | | contains, tolist(), and the start/stop/step attributes. This includes removing the 4th ('repeat') argument to PyRange_New().
* This change adjusts the profiling/tracing support so that the commonFred Drake2001-07-031-0/+1
| | | | | | | | | | | | | | | | path (with no profile/trace function) through eval_code2() and eval_frame() avoids several checks. In the common cases of calls, returns, and exception propogation, eval_code2() and eval_frame() used to test two values in the thread-state: the profiling function and the tracing function. With this change, a flag is set in the thread-state if either of these is active, allowing a single check to suffice when both are NULL. This also simplifies the code needed when either function is in use but is already active (to avoid profiling/tracing the profiler/tracer); the flag is set to 0 when the profile/trace code is entered, allowing the same check to suffice for "already in the tracer" for call/return/ exception events.
* removed "register const" from scalar arguments to the unicodeFredrik Lundh2001-06-271-15/+15
| | | | predicates
* Revise the interface to the profiling and tracing support for theFred Drake2001-06-272-2/+16
| | | | | | | | | | | | | | | Python interpreter. This change adds two new C-level APIs: PyEval_SetProfile() and PyEval_SetTrace(). These can be used to install profile and trace functions implemented in C, which can operate at much higher speeds than Python-based functions. The overhead for calling a C-based profile function is a very small fraction of a percent of the overhead involved in calling a Python-based function. The machinery required to call a Python-based profile or trace function been moved to sysmodule.c, where sys.setprofile() and sys.setprofile() simply become users of the new interface.
* use Py_UNICODE_WIDE instead of USE_UCS4_STORAGE and Py_UNICODE_SIZEFredrik Lundh2001-06-271-6/+7
| | | | tests.
* Encode surrogates in UTF-8 even for a wide Py_UNICODE.Martin v. Löwis2001-06-271-0/+3
| | | | | | | Implement sys.maxunicode. Explicitly wrap around upper/lower computations for wide Py_UNICODE. When decoding large characters with UTF-8, represent expected test results using the \U notation.
* Make Unicode work a bit better on Windows...Fredrik Lundh2001-06-261-0/+8
|