| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
refactoring to get all the duplicates of this delicate code out of the
cPickle and struct modules.
|
|
|
|
|
|
|
|
|
| |
variables to store internal data. As a result, any atempts to use the
unicode system with multiple active interpreters, or successive
interpreter executions, would fail.
Now that information is stored into members of the PyInterpreterState
structure.
|
|
|
|
|
|
| |
to more accurately describe what the function does.
Suggested by Thomas Wouters.
|
|
|
|
| |
Factors out the common case of returning self.
|
|
|
|
|
| |
classes defined by Python code using a class statement) is now
exported from object.h as PyHeapTypeObject. (SF patch #696193.)
|
|
|
|
| |
Remove prototype and doc. Backport candidate.
|
|
|
|
|
| |
the #ifdef HAVE_NCURSES_H: the same problem exists on OSX 10.1 with
a fink-installed curses (which uses curses.h as the include file name).
|
| |
|
| |
|
|
|
|
|
| |
called something else!). I can't imagine removing the prototype is
going to hurt, but put it back if *you* can.
|
|
|
|
| |
instead of a plain PyObject *. (SF patch #686601 by Ben Laurie.)
|
| |
|
|
|
|
|
|
|
|
|
| |
with an indented code block but no newline would raise SyntaxError.
This would have been a four-line change in parsetok.c... Except
codeop.py depends on this behavior, so a compilation flag had to be
invented that causes the tokenizer to revert to the old behavior;
this required extra changes to 2 .h files, 2 .c files, and 2 .py
files. (Fixes SF bug #501622.)
|
| |
|
|
|
|
| |
Incorporated nnorwitz's comment re. Py__USING_UNICODE.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
-DCALL_PROFILE: Count the number of function calls executed.
When this symbol is defined, the ceval mainloop and helper functions
count the number of function calls made. It keeps detailed statistics
about what kind of object was called and whether the call hit any of
the special fast paths in the code.
Optimization:
When we take the fast_function() path, which seems to be taken for
most function calls, and there is minimal frame setup to do, avoid
call PyEval_EvalCodeEx(). The eval code ex function does a lot of
work to handle keywords args and star args, free variables,
generators, etc. The inlined version simply allocates the frame and
copies the arguments values into the frame.
The optimization gets a little help from compile.c which adds a
CO_NOFREE flag to code objects that don't have free variables or cell
variables. This change allows fast_function() to get into the fast
path with fewer tests.
I measure a couple of percent speedup in pystone with this change, but
there's surely more that can be done.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
__module__ is the string name of the module the function was defined
in, just like __module__ of classes. In some cases, particularly for
C functions, the __module__ may be None.
Change PyCFunction_New() from a function to a macro, but keep an
unused copy of the function around so that we don't change the binary
API.
Change pickle's save_global() to use whichmodule() if __module__ is
None, but add the __module__ logic to whichmodule() since it might be
used outside of pickle.
|
|
|
|
|
|
|
|
|
| |
needs of pickling longs. Backed off to a definition that's much easier
to understand. The pickler will have to work a little harder, but other
uses are more likely to be correct <0.5 wink>.
_PyLong_Sign(): New teensy function to characterize a long, as to <0, ==0,
or >0.
|
|
|
|
|
|
|
| |
start for the C implemention of new pickle LONG1 and LONG4 opcodes (the
linear-time way to pickle a long is to call _PyLong_AsByteArray, but
the caller has no idea how big an array to allocate, and correct
calculation is a bit subtle).
|
|
|
|
| |
Gernot Hillier added more detail to the internal API documentation.
|
|
|
|
|
|
|
| |
the AEDesc data shouldn't be disposed when the Python object is.
Added a C call AEDesc_NewBorrowed() to create these objects and a Python
method old=AEDesc.AutoDispose(onoff) to change auto-dispose state.
|
| |
|
| |
|
|
|
|
| |
HASTZINFO() macro.
|
|
|
|
|
|
|
| |
hoped it would be, but not too bad. A test had to change:
time.__setstate__() can no longer add a non-None tzinfo member to a time
object that didn't already have one, since storage for a tzinfo member
doesn't exist in that case.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The attached patch enables shared extension
modules to build cleanly under Cygwin without
moving the static initialization of certain function
pointers (i.e., ones exported from the Python
DLL core) to a module initialization function.
Additionally, this patch fixes the modules that
have been changed in the past to accommodate
Cygwin.
|
|
|
|
| |
functions are here. Suggested by Skip.
|
| |
|
| |
|
|
|
|
|
|
| |
Initialize the small integers and __builtins__ in startup.
This removes some if conditions.
Change XDECREF to DECREF for values which shouldn't be NULL.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- new import hooks in import.c, exposed in the sys module
- new module called 'zipimport'
- various changes to allow bootstrapping from zip files
I hope I didn't break the Windows build (or anything else for that
matter), but then again, it's been sitting on sf long enough...
Regarding the latest discussions on python-dev: zipimport sets
pkg.__path__ as specified in PEP 273, and likewise, sys.path item such as
/path/to/Archive.zip/subdir/ are supported again.
|
|
|
|
|
|
|
| |
This can cause core dumps when Python runs. Python relies on the 754-
(and C99-) mandated default "non-stop" mode for FP exceptions. This
patch from Ben Laurie disables at least one FP exception on FreeBSD at
Python startup time.
|
| |
|
|
|
|
| |
It would be nice to support other compilers besides gcc.
|
|
|
|
|
| |
to others to argue about how to build it on other platforms (on Windows
it's in its own DLL).
|
| |
|
| |
|
|
|
|
|
|
|
| |
Most of these patches are from Thomas Heller, with long lines folded
by Tim. The change to test_descr.py is from Guido. See the bug report.
Not a bugfix candidate -- METH_CLASS is new in 2.3.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
| |
system headers have two declarations for wchar_t, with different guard macros.
Not sure whether this is a bugfix candidate, that depends on what changed in the
curses module.
|
|
|
|
|
| |
reported by Michael Hudson in
http://mail.python.org/pipermail/python-dev/2002-November/030299.html
|
|
|
|
|
|
| |
Py_Init crash". refchain cannot be cleared because objects can live across
Py_Finalize() and Py_Initialize() if they are kept alive by circular
references.
|
|
|
|
|
|
|
|
| |
[ 617309 ] getframe hook (Psyco #1)
[ 617311 ] Tiny profiling info (Psyco #2)
[ 617312 ] debugger-controlled jumps (Psyco #3)
These are forward ports from 2.2.2.
|
| |
|
| |
|
|
|
|
| |
Use integers in stat tuple, optionally floats in named fields.
|
|
|
|
|
| |
Don't pollute the namespace when protecting against multiple header inclusion.
Prefix with Py_ and use standard naming convention Py_FILENAME_H.
|
| |
|