- 01 Mar, 2001 2 kayıt (commit)
-
-
Guido van Rossum yazdı
- In _portable_ftell(), try fgetpos() before ftello() and ftell64(). I ran into a situation on a 64-bit capable Linux where the C library's ftello() and ftell64() returned negative numbers despite fpos_t and off_t both being 64-bit types; fgetpos() did the right thing. - Define a new typedef, Py_off_t, which is either fpos_t or off_t, depending on which one is 64 bits. This removes the need for a lot of #ifdefs later on. (XXX Should this be moved to pyport.h? That file currently seems oblivious to large fille support, so for now I'll leave it here where it's needed.)
-
Jeremy Hylton yazdı
-
- 28 Şub, 2001 1 kayıt (commit)
-
-
Jeremy Hylton yazdı
A user program could delete a function's func_closure, which would cause it to crash when called.
-
- 27 Şub, 2001 1 kayıt (commit)
-
-
Neil Schemenauer yazdı
closes SF patch #401229.
-
- 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.
-
- 23 Şub, 2001 1 kayıt (commit)
-
-
Barry Warsaw yazdı
release the interned string dictionary. This is useful for memory use debugging because it eliminates a huge source of noise from the reports. Only defined when INTERN_STRINGS is defined.
-
- 22 Şub, 2001 2 kayıt (commit)
-
-
Barry Warsaw yazdı
crashing.
-
Guido van Rossum yazdı
and the test for errors, so that an error in the default compare doesn't go undetected. This fixes SF Bug #132933 (submitted by effbot) -- list.sort doesn't detect comparision errors.
-
- 18 Şub, 2001 1 kayıt (commit)
-
-
Fredrik Lundh yazdı
less likely that bug #132817 ever appears again)
-
- 12 Şub, 2001 1 kayıt (commit)
-
-
Guido van Rossum yazdı
This fixes SF bug #132008, reported by Warren J. Hack. The copyright for this patch (and this patch only) belongs to CNRI, as part of the (yet to be issued) 1.6.1 release. This is now checked into the HEAD branch. Tim will check in a test case to check for this specific bug, and an assertion in PyArgs_ParseTuple() to catch similar bugs in the future.
-
- 03 Şub, 2001 1 kayıt (commit)
-
-
Neil Schemenauer yazdı
-
- 01 Şub, 2001 2 kayıt (commit)
-
-
Jeremy Hylton yazdı
PyFPE_END_PROTECT() was called on undefined var
-
Fred Drake yazdı
-
- 29 Ock, 2001 5 kayıt (commit)
-
-
Guido van Rossum yazdı
typedef, and at least one compiler choked on this. (SF patch #103457, by bquinlan)
-
Jeremy Hylton yazdı
This change eliminates an extra malloc/free when a frame with free variables is created. Any cell vars or free vars are stored in f_localsplus after the locals and before the stack. eval_code2() fills in the appropriate values after handling initialization of locals. To track the size the frame has an f_size member that tracks the total size of f_localsplus. It used to be implicitly f_nlocals + f_stacksize.
-
Jeremy Hylton yazdı
-
Marc-André Lemburg yazdı
corresponding string method. Added tests for this too. Patch written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
-
Moshe Zadka yazdı
* Removed func_hash and func_compare, so they can be treated as immutable content-less objects (address hash and comparison) * Added tests to that affect to test_funcattrs (also testing func_code is writable) * Reverse meaning of tests in test_opcodes which checked identical code gets identical functions
-
- 28 Ock, 2001 1 kayıt (commit)
-
-
Fred Drake yazdı
-
- 25 Ock, 2001 2 kayıt (commit)
-
-
Jeremy Hylton yazdı
The majority of the changes are in the compiler. The mainloop changes primarily to implement the new opcodes and to pass a function's closure to eval_code2(). Frames and functions got new slots to hold the closure. Include/compile.h Add co_freevars and co_cellvars slots to code objects. Update PyCode_New() to take freevars and cellvars as arguments Include/funcobject.h Add func_closure slot to function objects. Add GetClosure()/SetClosure() functions (and corresponding macros) for getting at the closure. Include/frameobject.h PyFrame_New() now takes a closure. Include/opcode.h Add four new opcodes: MAKE_CLOSURE, LOAD_CLOSURE, LOAD_DEREF, STORE_DEREF. Remove comment about old requirement for opcodes to fit in 7 bits. compile.c Implement changes to code objects for co_freevars and co_cellvars. Modify symbol table to use st_cur_name (string object for the name of the current scope) and st_cur_children (list of nested blocks). Also define st_nested, which might more properly be called st_cur_nested. Add several DEF_XXX flags to track def-use information for free variables. New or modified functions of note: com_make_closure(struct compiling *, PyCodeObject *) Emit LOAD_CLOSURE opcodes as needed to pass cells for free variables into nested scope. com_addop_varname(struct compiling *, int, char *) Emits opcodes for LOAD_DEREF and STORE_DEREF. get_ref_type(struct compiling *, char *name) Return NAME_CLOSURE if ref type is FREE or CELL symtable_load_symbols(struct compiling *) Decides what variables are cell or free based on def-use info. Can now raise SyntaxError if nested scopes are mixed with exec or from blah import *. make_scope_info(PyObject *, PyObject *, int, int) Helper functions for symtable scope stack. symtable_update_free_vars(struct symtable *) After a code block has been analyzed, it must check each of its children for free variables that are not defined in the block. If a variable is free in a child and not defined in the parent, then it is defined by block the enclosing the current one or it is a global. This does the right logic. symtable_add_use() is now a macro for symtable_add_def() symtable_assign(struct symtable *, node *) Use goto instead of for (;;) Fixed bug in symtable where name of keyword argument in function call was treated as assignment in the scope of the call site. Ex: def f(): g(a=2) # a was considered a local of f ceval.c eval_code2() now take one more argument, a closure. Implement LOAD_CLOSURE, LOAD_DEREF, STORE_DEREF, MAKE_CLOSURE> Also: When name error occurs for global variable, report that the name was global in the error mesage. Objects/frameobject.c Initialize f_closure to be a tuple containing space for cellvars and freevars. f_closure is NULL if neither are present. Objects/funcobject.c Add support for func_closure. Python/import.c Change the magic number. Python/marshal.c Track changes to code objects.
-
Jeremy Hylton yazdı
A cell contains a reference to a single PyObject. It could be implemented as a mutable, one-element sequence, but the separate type has less overhead.
-
- 24 Ock, 2001 4 kayıt (commit)
-
-
Guido van Rossum yazdı
tp_richcompare field! (Hopefully this will make Python 2.1 binary compatible with certain Zope extensions. :-)
-
Ka-Ping Yee yazdı
Switch from octal escapes to hex escapes for other nonprintable characters.
-
Fredrik Lundh yazdı
crop of changes, the files are small enough to do this). Also adds "name" and "lookup" functions to unicodedata.
-
Barry Warsaw yazdı
PyGC_Dump() -> _PyGC_Dump()
-
- 23 Ock, 2001 2 kayıt (commit)
-
-
Barry Warsaw yazdı
PyGC_Dump(): Wrap this in a #ifdef WITH_CYCLE_GC.
-
Barry Warsaw yazdı
PyObject_Dump(): New function that is useful when debugging Python's C runtime. In something like gdb it can be a pain to get some useful information out of PyObject*'s. This function prints the str() of the object to stderr, along with the object's refcount and hex address. PyGC_Dump(): Similar to PyObject_Dump() but knows how to cast from the garbage collector prefix back to the PyObject* structure. [See Misc/gdbinit for some useful gdb hooks] none_dealloc(): Rather than SEGV if we accidentally decref None out of existance, we assign None's and NotImplemented's destructor slot to this function, which just calls abort().
-
- 22 Ock, 2001 2 kayıt (commit)
-
-
Guido van Rossum yazdı
(unless the object's type overrides this comparison).
-
Guido van Rossum yazdı
ones.
-
- 21 Ock, 2001 2 kayıt (commit)
-
-
Fredrik Lundh yazdı
-
Neil Schemenauer yazdı
-
- 20 Ock, 2001 3 kayıt (commit)
-
-
Fredrik Lundh yazdı
errors aren't that helpful), or doesn't contain what's expected from it. Also tweaked the test script so it compiles even if ucnhash is missing.
-
Barry Warsaw yazdı
Barry, that comment belongs in the code, not in the checkin msg. The code *used* to do this correctly (as you well know, since you & I went thru considerable pain to fix this the first time). However, because the *reason* for the convolution wasn't recorded in the code as a comment, somebody threw it all away the first time it got reworked. c-code-isn't-often-self-explanatory-ly y'rs - tim default_3way_compare(): Stick the checkin message from 2.110 in a comment.
-
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.
-
- 19 Ock, 2001 3 kayıt (commit)
-
-
Barry Warsaw yazdı
del'ing func.func_dict. I took the opportunity to also clean up some other nits with the code, namely core dumps when del'ing func_defaults and KeyError instead of AttributeError when del'ing a non-existant function attribute. Specifically, func_memberlist: Move func_dict and __dict__ into here instead of special casing them in the setattro and getattro methods. I don't remember why I took them out of here before I first uploaded the PEP 232 patch. :/ func_getattro(): No need to special case __dict__/func_dict since their now in the func_memberlist and PyMember_Get() should Do The Right Thing (i.e. transforms NULL values into Py_None). func_setattro(): Document the intended behavior of del'ing or setting to None one of the special func_* attributes. I.e.: func_code - can only be set to a code object. It can't be del'd or set to None. func_defaults - can be del'd. Can only be set to None or a tuple. func_dict - can be del'd. Can only be set to None or a dictionary. Fix core dumps and incorrect exceptions as described above. Also, if we're del'ing an arbitrary function attribute but func_dict is NULL, don't create func_dict before discovering that we'll get an AttributeError anyway.
-
Fredrik Lundh yazdı
implementation details inside the ucnhash module. also cleaned up the unicode copyright blurb a little; Secret Labs' internal revision history isn't that interesting...
-
Tim Peters yazdı
Also fixes two long-standing bugs (present in 2.0): 1. .join() didn't check that the result size fit in an int. 2. string.join(s) when len(s)==1 returned s[0] regardless of s[0]'s type; e.g., "".join([3]) returned 3 (overly optimistic optimization). I resisted a keen temptation to make .join() apply str() automagically.
-
- 18 Ock, 2001 2 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.)
-
Guido van Rossum yazdı
tp_compare and tp_richcompare NULL before deciding to do a quickie based on the object address. (Tim Peters discovered this.)
-