summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
Commit message (Collapse)AuthorAgeFilesLines
* Change the default repr() and str() of class instance objects to lookGuido van Rossum1997-12-031-1/+9
| | | | | like <modulename.classname instance at ...> (to match the repr() of class objects.
* Undo another glitch of the automatic not-so-Grand Renaming; some localGuido van Rossum1997-11-181-10/+10
| | | | | variables called 'coerce' were accidentally renamed to 'PyNumber_Coerce'. Rename them back to coercefunc.
* Write a str() function for class objects that returnsGuido van Rossum1997-10-201-2/+36
| | | | "modulename.classname" instead of returning the same as repr().
* Check that all base classes are indeed class objects, rather thanGuido van Rossum1997-10-071-5/+30
| | | | expecting the caller to do so.
* When creating a class, set its __module__ attribute to the moduleGuido van Rossum1997-09-121-1/+22
| | | | | whose name is in the current globals' __name__ variable. If __name__ is not set, ignore this.
* Allow assignments to instance.__dict__ and instance.__class__. TheGuido van Rossum1997-08-251-17/+57
| | | | | | | | | | | | former lets you give an instance a set of new instance vars. The latter lets you give it a new class. Both are typechecked and disallowed in restricted mode. For classes, the check for read-only special attributes is tightened so that only assignments to __dict__, __bases__, __name__, __getattr__, __setattr__, and __delattr__ (these could be made to work as well, but I don't know if that's useful -- let's see first whether mucking with instances will help).
* Added separate free list for instance method objects, for a fewGuido van Rossum1997-08-051-4/+28
| | | | percent speed up. Also add PyMethod_Fini() to discard it.
* PyObject_Compare can raise an exception now.Guido van Rossum1997-05-231-4/+12
|
* removed last #ifdef SUPPORT_OBSOLETE_ACCESS bits.Guido van Rossum1997-05-091-87/+3
|
* Quickly renamed the last directory.Guido van Rossum1997-05-021-525/+537
|
* Intern the various string objects created to speed up lookups.Guido van Rossum1997-01-181-25/+25
|
* Yet more elaborate message for exception in __del__.Guido van Rossum1996-12-051-11/+23
| | | | Make gcc -Wall happy.
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Support passing in an empty dictionary of keywords to newinstanceobject.Guido van Rossum1996-10-211-1/+3
|
* More detailed error message about exception in __del__Guido van Rossum1996-09-111-3/+6
|
* Use getstringsize where available instead of strlen.Guido van Rossum1996-08-261-1/+1
|
* Be a bit more careful with printing a warning for a failed __del__.Guido van Rossum1996-08-221-2/+5
|
* More efficient handling of "__doc__" lookup.Guido van Rossum1996-08-211-2/+8
|
* Write warning about exception in __del__ to stderr, not stdout.Guido van Rossum1996-08-201-1/+1
|
* Disable support for access statementGuido van Rossum1996-08-121-4/+27
|
* Optimizations by Sjoerd:Guido van Rossum1996-08-091-81/+172
| | | | | - define tp_getattro, tp_setattro - use precreated string objects for most common exceptions and method names
* Only __dict__ and __class__ are read-only instance attributesGuido van Rossum1996-07-211-2/+4
|
* new debugger symbol namesGuido van Rossum1996-05-231-6/+6
|
* Added __name__ attribute to class instance method objects.Guido van Rossum1996-05-141-7/+15
| | | | | | Removed im_doc attribute; __name__ and __doc__ are now handled by special casing in instancemethodgetattr(). This saves a few bytes and INCREF/DECREF calls per i.m. object allocation/deallocation.
* Get ordering right for TRACE_REFS/COUNT_ALLOCS combination (otherwiseSjoerd Mullender1995-09-181-1/+1
| | | | may get inc_count sanity check abort).
* Fixed calling of __del__ method with TRACE_REFS defined.Sjoerd Mullender1995-08-281-1/+23
|
* class objects are read-only in restricted modeGuido van Rossum1995-08-041-0/+5
|
* changes for keyword args to built-in functions and classesGuido van Rossum1995-07-261-5/+6
|
* args to call_object must be tuple or NULLGuido van Rossum1995-07-121-6/+2
|
* change comparing instance methodsGuido van Rossum1995-04-061-4/+3
|
* removed unused varsGuido van Rossum1995-01-261-1/+0
|
* implement coercions involving instances properlyGuido van Rossum1995-01-101-1/+53
|
* add restrictions in restricted modeGuido van Rossum1995-01-101-24/+32
|
* * Objects/classobject.c: added 5th (function) parameter toGuido van Rossum1995-01-071-27/+49
| | | | | instancebinop, to support things like Rational * float; added documentation strings to classes and methods
* Added 1995 to copyright message.Guido van Rossum1995-01-041-2/+2
| | | | | floatobject.c: fix hash(). methodobject.c: support METH_FREENAME flag bit.
* Lots of minor changes. Note for mappingobject.c: the hash table pointerGuido van Rossum1995-01-021-5/+4
| | | | can now be NULL.
* fix comparison of instances without _-cmp__Guido van Rossum1994-11-101-3/+3
|
* Comparison of two class instances without __cmp__ or __rcmp__ methodsSjoerd Mullender1994-10-191-2/+5
| | | | was broken.
* * Include/classobject.h, Objects/classobject.c, Python/ceval.c:Guido van Rossum1994-09-281-159/+160
| | | | | | | | | | | | | | | | | | entirely redone operator overloading. The rules for class instances are now much more relaxed than for other built-in types (whose coerce must still return two objects of the same type) * Objects/floatobject.c: add overflow check when converting float to int and implement truncation towards zero using ceil/float * Objects/longobject.c: change ValueError to OverflowError when converting to int * Objects/rangeobject.c: modernized * Objects/stringobject.c: use HAVE_LIMITS instead of __STDC__ * Objects/xxobject.c: changed to use new style (not finished?)
* Yet another version (by me) of __getattr__ etc.Guido van Rossum1994-09-051-174/+51
|
* Mods (really diffs to 2.29) by Michael Scharf for alternative __getattr__ etc.Guido van Rossum1994-09-051-105/+204
|
* If an attribute is deleted, __setattr__ is called with 2 instead of 3Guido van Rossum1994-08-161-1/+5
| | | | arguments (adding __delattr__ was deemed too much overhead)
* * Objects/classobject.c, Include/classobject.h: added __getattr__Guido van Rossum1994-08-121-17/+99
| | | | | | | | and __setattr__ support to override getattr(x, name) and setattr(x, name, value) for class instances. This uses a special hack whereby the class is supposed to be static: the __getattr__ and __setattr__ methods are looked up only once and saved in the instance structure for speed
* Merge alpha100 branch back to main trunkGuido van Rossum1994-08-011-51/+51
|
* * timemodule.c: Add hack for Solaris 2.Guido van Rossum1993-11-231-8/+0
| | | | | | | | | | | | | | | * posixmodule.c: don't prototype getcwd() -- it's not portable... * mappingobject.c: double-check validity of last_name_char in dict{lookup,insert,remove}. * arraymodule.c: need memmove only for non-STDC Suns. * Makefile: comment out HTML_LIBS and XT_USE by default * pythonmain.c: don't prototype getopt() -- it's not standardized * socketmodule.c: cast flags arg to {get,set}sockopt() and addrbuf arg to recvfrom() to (ANY*). * pythonrun.c (initsigs): fix prototype, make it static * intobject.c (LONG_BIT): only #define it if not already defined * classobject.[ch]: remove all references to unused instance_convert() * mappingobject.c (getmappingsize): Don't return NULL in int function.
* Several optimizations and speed improvements.Sjoerd Mullender1993-10-221-7/+9
| | | | cstubs: Use Matrix type instead of float[4][4].
* Makefile, import.c: Lance's alternative module search (allow .pyc fileGuido van Rossum1993-10-151-5/+18
| | | | | | | | | | without .py file); Bill's dynamic loading for SunOS using shared libraries. pwdmodule.c (mkgrent): remove DECREF of uninitialized variable. classobject.c (instance_getattr): Fix case when class lookup returns unbound method instead of function.
* * classobject.c: in instance_getattr, don't make a method out of aGuido van Rossum1993-05-251-7/+8
| | | | | | | | | | function found as instance data. * socketmodule.c: added 'flags' argument sendto/recvfrom, rewrite argument parsing in send/recv. * More changes related to access (terminology change: owner instead of class; allow any object as owner; local/global variables are owned by their dictionary, only class/instance data is owned by the class; "from...import *" now only imports objects with public access; etc.)
* * Lots of small changes related to access.Guido van Rossum1993-05-211-31/+39
| | | | | | | * Added "access *: ...", made access work for class methods. * Introduced subclass check: make sure that when calling ClassName.methodname(instance, ...), the instance is an instance of ClassName or of a subclass thereof (this might break some old code!)
* Access checks now work, at least for instance data (not for methodsGuido van Rossum1993-05-201-85/+173
| | | | | | | yet). The class is now passed to eval_code and stored in the current frame. It is also stored in instance method objects. An "unbound" instance method is now returned when a function is retrieved through "classname.funcname", which when called passes the class to eval_code.