summaryrefslogtreecommitdiffstats
path: root/Objects/classobject.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Several changes in one:Guido van Rossum1993-05-191-13/+136
| | | | | | | | | | | | | | | | (1) dictionaries/mappings now have attributes values() and items() as well as keys(); at the C level, use the new function mappinggetnext() to iterate over a dictionary. (2) "class C(): ..." is now illegal; you must write "class C: ...". (3) Class objects now know their own name (finally!); and minor improvements to the way how classes, functions and methods are represented as strings. (4) Added an "access" statement and semantics. (This is still experimental -- as long as you don't use the keyword 'access' nothing should be changed.)
* Fix bug in class instance hash (forgot to clear error condition).Guido van Rossum1993-04-081-3/+8
|
* * Changed all copyright messages to include 1993.Guido van Rossum1993-03-291-8/+60
| | | | | | | | | | | | | | | | | * Stubs for faster implementation of local variables (not yet finished) * Added function name to code object. Print it for code and function objects. THIS MAKES THE .PYC FILE FORMAT INCOMPATIBLE (the version number has changed accordingly) * Print address of self for built-in methods * New internal functions getattro and setattro (getattr/setattr with string object arg) * Replaced "dictobject" with more powerful "mappingobject" * New per-type functio tp_hash to implement arbitrary object hashing, and hashobject() to interface to it * Added built-in functions hash(v) and hasattr(v, 'name') * classobject: made some functions static that accidentally weren't; added __hash__ special instance method to implement hash() * Added proper comparison for built-in methods and functions
* * Changed many files to use mkvalue() instead of newtupleobject().Guido van Rossum1993-03-161-3/+3
| | | | | | | | | | * Fixcprt.py: added [-y file] option, do only files younger than file. * modsupport.[ch]: added vmkvalue(). * intobject.c: use mkvalue(). * stringobject.c: added "formatstring"; renamed string* to string_*; ceval.c: call formatstring for string % value. * longobject.c: close memory leak in divmod. * parsetok.c: set result node to NULL when returning an error.
* bltinmodule.c: added round(x, [n]); coerce() of two class instancesGuido van Rossum1993-02-121-2/+2
| | | | | | will try to coerce anyway. classobject.c: instance 'nonzero' should first try __nonzero__ only then __len__.
* * classobject.c: in instance_lenth, test result of call_objectGuido van Rossum1992-11-261-0/+2
| | | | | | for exception before using it. Fixed a few other places where the outcome of calling sq_length wasn't tested for exceptions (bltinmodule.c, ceval.c).
* * Makefile: added IMGFILE; moved some stuff around.Guido van Rossum1992-09-171-25/+1
| | | | | | | | * flmodule.c: added some missing functions; changed readonly flags of some data members based upon FORMS documentation. * listobject.c: fixed int/long arg lint bug (bites PC compilers). * several: removed redundant print methods (repr is good enough). * posixmodule.c: added (still experimental) process group functions.
* Made builtins int(), long(), float(), oct() and hex() more generic.Guido van Rossum1992-09-121-0/+11
|
* classobject.c moduleobject.c stdwinmodule.c xxobject.c:Guido van Rossum1992-09-041-4/+14
| | | | | raise AttributeError, not KeyError, when attribute deletion fails. sunaudiodevmodule.c: check for deletion before calling setmember.
* Compare instance methods by comparing the object and the function.Guido van Rossum1992-09-031-1/+11
|
* * macmodule.c: include allobjects.h, not .cGuido van Rossum1992-08-141-5/+5
| | | | | | * timemodule.c: the mac has no unistd.h * classobject.c: fixed several cases of return NULL that should be return -1 !!!
* * classobject.[ch], {float,long,int}object.c, bltinmodule.c:Guido van Rossum1992-08-141-56/+56
| | | | | | coercion is now completely generic. * ceval.c: for instances, don't coerce for + and *; * reverses arguments if left one is non-instance numeric and right one sequence.
* Changes so that user-defined classes can implement operations invokedGuido van Rossum1992-08-121-7/+494
| | | | | by special syntax: you can now define your own numbers, sequences and mappings.
* Don't allow assignment to attributes named __*__Guido van Rossum1992-04-051-2/+16
|
* Silence lintGuido van Rossum1992-03-271-2/+2
|
* The cl_bases member of a class object is now never NULL.Guido van Rossum1991-12-101-8/+15
|
* Deleted unused local variable.Guido van Rossum1991-11-191-1/+0
|
* Add several secret __*__ attributesGuido van Rossum1991-10-201-9/+50
|
* Renamed class methods to instance methods (which they are)Guido van Rossum1991-05-051-59/+59
|
* Rename class methods to instance methods (at least where user-visible)Guido van Rossum1991-04-161-3/+3
|
* Change ugly 'class member' to more normal 'instance'.Guido van Rossum1991-04-041-19/+19
|
* Added copyright notice.Guido van Rossum1991-02-191-0/+24
|
* "Compiling" versionGuido van Rossum1990-12-201-16/+21
|
* New errors.Guido van Rossum1990-10-211-6/+6
|
* (Some) new error handling.Guido van Rossum1990-10-141-1/+2
|
* Initial revisionGuido van Rossum1990-10-141-0/+268