0
0
mirror of https://github.com/python/cpython.git synced 2024-11-28 16:45:42 +01:00
Commit Graph

218 Commits

Author SHA1 Message Date
Guido van Rossum
32b582b953 fix strobject() behavior 1995-01-17 16:35:13 +00:00
Guido van Rossum
b0fe3a9312 added reverselist; free recycling bin on error exit 1995-01-17 16:34:45 +00:00
Guido van Rossum
3535f6e0a1 long_scan is no longer used 1995-01-17 16:34:13 +00:00
Guido van Rossum
ce00509702 make a few things static 1995-01-17 16:33:39 +00:00
Guido van Rossum
4d3468deab don't declare fmod/pow for any STDC compiler 1995-01-17 16:33:14 +00:00
Guido van Rossum
b4e7e25fe6 different init for __builtins__ 1995-01-17 16:27:25 +00:00
Guido van Rossum
087579ea51 added $& to $(LIB) target for Sequent 1995-01-17 16:11:29 +00:00
Guido van Rossum
ae7bf1a5e7 fix reentrancy bug in slice assignment 1995-01-17 10:21:11 +00:00
Guido van Rossum
20566845c6 properly implement cmp() for class instances 1995-01-12 11:26:10 +00:00
Guido van Rossum
5524a59b09 move coerce() from bltinmodule.c to object.c and implement builtin_coerce() differently 1995-01-10 15:26:20 +00:00
Guido van Rossum
879c581826 implement coercions involving instances properly 1995-01-10 15:24:06 +00:00
Guido van Rossum
c206c766dd fix memory leak and null pointer dereference 1995-01-10 15:23:19 +00:00
Guido van Rossum
10393b1708 add restrictions in restricted mode 1995-01-10 10:39:49 +00:00
Guido van Rossum
c113482871 add builtins handling and restricted flag 1995-01-10 10:39:16 +00:00
Guido van Rossum
e7d444f785 * Objects/classobject.c: added 5th (function) parameter to
instancebinop, to support things like Rational * float; added
	documentation strings to classes and methods
1995-01-07 12:35:18 +00:00
Guido van Rossum
cab650db8e * Objects/methodobject.c: changed drastically, the object now
contains a pointer to the struct methodlist (which must be
	static); added attributes __name__, __doc__ and __self__
1995-01-07 12:34:58 +00:00
Guido van Rossum
5bd3805ae9 Added __doc__ attribute (alias func_doc), initialized from first
constant in code object if it is a string, else None
1995-01-07 12:01:30 +00:00
Guido van Rossum
8b14b4c733 initialize __doc__ to None 1995-01-07 11:59:29 +00:00
Guido van Rossum
29ca26eebf added getattr(), supporting __doc__ and _name__ 1995-01-07 11:58:15 +00:00
Guido van Rossum
016564ab51 attribute-less object is AttributeError, not TypeError 1995-01-07 11:54:44 +00:00
Guido van Rossum
6610ad9d6b Added 1995 to copyright message.
floatobject.c: fix hash().
methodobject.c: support METH_FREENAME flag bit.
1995-01-04 19:07:38 +00:00
Guido van Rossum
efc8713428 * Objects/mappingobject.c (mappingremove): don't call
lookmapping() for empty dictionary
1995-01-02 19:42:39 +00:00
Guido van Rossum
d7047b395e Lots of minor changes. Note for mappingobject.c: the hash table pointer
can now be NULL.
1995-01-02 19:07:15 +00:00
Guido van Rossum
bb3c5f7406 fix comparison of instances without _-cmp__ 1994-11-10 22:31:02 +00:00
Sjoerd Mullender
b9a6d12498 Comparison of two class instances without __cmp__ or __rcmp__ methods
was broken.
1994-10-19 15:11:52 +00:00
Guido van Rossum
03093a248d * Include/classobject.h, Objects/classobject.c, Python/ceval.c:
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?)
1994-09-28 15:51:32 +00:00
Guido van Rossum
9776adf565 rearranged code in debugging version of DELREF to avoid touching data
after it has been freed.
1994-09-07 14:36:45 +00:00
Guido van Rossum
52ca98a390 Yet another version (by me) of __getattr__ etc. 1994-09-05 07:32:29 +00:00
Guido van Rossum
e773754ae5 Mods (really diffs to 2.29) by Michael Scharf for alternative __getattr__ etc. 1994-09-05 07:31:41 +00:00
Guido van Rossum
1d5735e846 Merge back to main trunk 1994-08-30 08:27:36 +00:00
Guido van Rossum
013142a95f fix nasty bug in resizing (formatstring) 1994-08-30 08:19:36 +00:00
Guido van Rossum
bf8c0e336f mods by Andrew Kuchling to implement
pow(x,y,z) == pow(x,y)%z, but without incurring overflow
Correct problems found by THINK C 6.0
1994-08-29 12:48:32 +00:00
Guido van Rossum
eb1fafcec1 New patches by Andrew to fix various problems
Add cast for Lance
1994-08-29 12:47:19 +00:00
Guido van Rossum
6cd2fe043b Correct problems found by THINK C 6.0 1994-08-29 12:45:32 +00:00
Guido van Rossum
f0171a1626 * configure.in, */Makefile*.in: OPT can now be specified in the
env at configure time and will then be put in all Makefiles as
	default
	* */Makefile*.in: remove lib*.a before adding to it
1994-08-23 14:06:18 +00:00
Guido van Rossum
91ab4a8353 If an attribute is deleted, __setattr__ is called with 2 instead of 3
arguments (adding __delattr__ was deemed too much overhead)
1994-08-16 22:13:47 +00:00
Guido van Rossum
0b7d02a36f New patches by Andrew to fix various problems 1994-08-12 12:52:35 +00:00
Guido van Rossum
e149fa2a1e * Objects/classobject.c, Include/classobject.h: added __getattr__
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
1994-08-12 12:49:46 +00:00
Guido van Rossum
b6775db241 Merge alpha100 branch back to main trunk 1994-08-01 11:34:53 +00:00
Guido van Rossum
2e1d433e43 Added getmaxint() so sys can initialize sys.maxint.
Added Makefile.in.
1993-12-24 10:22:45 +00:00
Guido van Rossum
7d6aa51b56 * rangeobject.[ch], bltinmodule.c: incorporate new version of range
object (unchanged from source except "range" -> "xrange").
1993-12-21 22:50:31 +00:00
Guido van Rossum
455b87d457 New file 1993-12-20 11:43:21 +00:00
Guido van Rossum
590baa4a7a * import.c (get_module): pass .py filename to parse_file, not .pyc filename!
* funcobject.c (func_repr): don't call getstringvalue(None) for anonymous
  functions.
* bltinmodule.c: removed lambda (which is now a built-in function);
  removed implied lambda for string arg to filter/map/reduce.
* Grammar, graminit.[ch], compile.[ch]: replaced lambda as built-in
  function by lambda as grammar entity: instead of "lambda('x: x+1')" you
  write "lambda x: x+1".
* Xtmodule.c (checkargdict): return 0, not NULL, for error.
1993-11-30 13:40:46 +00:00
Guido van Rossum
8732d6aeea Fix lay-out of previous fix. 1993-11-23 17:54:03 +00:00
Guido van Rossum
b376a4ad18 * timemodule.c: Add hack for Solaris 2.
* 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.
1993-11-23 17:53:17 +00:00
Guido van Rossum
c45611d0e3 * import.c (get_module): total rewrite, to ensure proper search order: for
each dir in sys.path, try each possible extension.  (Note: C extensions
  are loaded before Python modules in the same directory, to allow having
  a C version used when dynamic loading is supported and a Python version
  as a back-up.)
* import.c (reload_module): test for error from getmodulename()
* moduleobject.c: implement module name as dict entry '__name__' instead
  of special-casing it in module_getattr(); this way a module (or
  function!) can access its own module name, and programs that know what
  they are doing can rename modules.
* stdwinmodule.c (initstdwin): strip ".py" suffix of argv[0].
1993-11-17 22:58:56 +00:00
Guido van Rossum
71e57d090d Fix the fix :-( 1993-11-11 15:03:51 +00:00
Guido van Rossum
6938a297da Three micro fixes to formatstring 1993-11-11 14:51:57 +00:00
Guido van Rossum
52f2c05401 * parsermodule.c, Makefile, config.c: rudimentary interface to the Python
parser.
* mappingobject.c (lookmapping): 'freeslot' was never used due to a bug in
  the code.
1993-11-10 12:53:24 +00:00
Guido van Rossum
a3d78fb268 * posixmodule.c: added set{uid,gid}.
* {tuple,list,mapping,array}object.c: call printobject with 0 for flags
* compile.c (parsestr): use quote instead of '\'' at one crucial point
* arraymodule.c (array_getattr): Added __members__ attribute
1993-11-10 09:23:53 +00:00