summaryrefslogtreecommitdiff
path: root/Python/bltinmodule.c
AgeCommit message (Collapse)AuthorLines
1997-12-10Need a cast when comparing type object in isinstance()Guido van Rossum-1/+1
1997-12-02Support type objects in isinstance().Guido van Rossum-10/+15
E.g. isinstance('',types.StringType) will return true now instead of raising a TypeError exception. This is for JPython compatibility.
1997-09-26Release interpreter lock around readline call in [raw_]input().Guido van Rossum-0/+2
1997-09-18initerrors(): Eliminate circular reference which was causing a smallBarry Warsaw-3/+3
but annoying memory leak. This was introduced when PyExc_Exception was added; the loop above populating the PyExc_StandardError exception tuple started at index 1 in bltin_exc, but PyExc_Exception was added at index 0, so PyExc_StandardError was getting inserted in itself! How else can a tuple include itself?! Change the loop to start at index 2. This was a *fun* one! :-)
1997-09-16[Py_Exc]NumberError => [Py_Exc]ArithmeticErrorBarry Warsaw-7/+7
1997-09-16Introduce PyExc_Exception as the conceptual root class for all exceptions.Guido van Rossum-0/+7
1997-09-05First part of package support.Guido van Rossum-1/+1
This doesn't yet support "import a.b.c" or "from a.b.c import x", but it does recognize directories. When importing a directory, it initializes __path__ to a list containing the directory name, and loads the __init__ module if found. The (internal) find_module() and load_module() functions are restructured so that they both also handle built-in and frozen modules and Mac resources (and directories of course). The imp module's find_module() and (new) load_module() also have this functionality. Moreover, imp unconditionally defines constants for all module types, and has two more new functions: find_module_in_package() and find_module_in_directory(). There's also a new API function, PyImport_ImportModuleEx(), which takes all four __import__ arguments (name, globals, locals, fromlist). The last three may be NULL. This is currently the same as PyImport_ImportModule() but in the future it will be able to do relative dotted-path imports. Other changes: - bltinmodule.c: in __import__, call PyImport_ImportModuleEx(). - ceval.c: always pass the fromlist to __import__, even if it is a C function, so PyImport_ImportModuleEx() is useful. - getmtime.c: the function has a second argument, the FILE*, on which it applies fstat(). According to Sjoerd this is much faster. The first (pathname) argument is ignored, but remains for backward compatibility (so the Mac version still works without changes). By cleverly combining the new imp functionality, the full support for dotted names in Python (mini.py, not checked in) is now about 7K, lavishly commented (vs. 14K for ni plus 11K for ihooks, also lavishly commented). Good night!
1997-08-29Removed obsolete exception PyExc_AccessError.Barry Warsaw-43/+171
Added PyErr_MemoryErrorInst to hold the pre-instantiated instance when using class based exceptions. Simplified the creation of all built-in exceptions, both class based and string based. Actually, for class based exceptions, the string ones are still created just in case there's a problem creating the class based ones (so you still get *some* exception handling!). Now the init and fini functions run through a list of structure elements, creating the strings (and optionally classes) for every entry. initerrors(): the new base class exceptions StandardError, LookupError, and NumberError are initialized when using string exceptions, to tuples containing the list of derived string exceptions. This GvR trick enables forward compatibility! One bit of nastiness is that the C code has to know the inheritance tree embodied in exceptions.py. Added the two phase init and fini functions.
1997-08-22Two new built-in functions: issubclass() and isinstance(). Both takeBarry Warsaw-5/+59
classes as their second arguments. The former takes a class as the first argument and returns true iff first is second, or is a subclass of second. The latter takes any object as the first argument and returns true iff first is an instance of the second, or any subclass of second. Also, change all occurances of pointer compares against PyExc_IndexError with PyErr_ExceptionMatches() calls.
1997-08-02The last of the mass checkins for separate (sub)interpreters.Guido van Rossum-50/+71
Everything should now work again. See the comments for the .h files mass checkin (e.g. pystate.h) for more detail.
1997-05-23PyObject_Compare can raise an exception now.Guido van Rossum-4/+14
1997-05-09Oops -- missed FloatingPointError in renaming.Guido van Rossum-2/+2
1997-05-07Instead of importing graminit.h whenever one of the three grammar 'root'Guido van Rossum-7/+6
symbols is needed, define these in Python.h with a Py_ prefix.
1997-05-06New dir() function --Guido van Rossum-22/+48
- uses abstract interface where possible - uses __members__ and __methods__ - returns [] when an object has no info available
1997-04-30Avoid sprintf buffer overflow if more than 9999 arguments.Guido van Rossum-1/+1
1997-04-29Quickly renamed the remaining files -- this directory is done.Guido van Rossum-661/+676
1997-04-11Keep gcc -Wall and Microsoft VC happy.Guido van Rossum-3/+5
1997-03-311. Add string conversions to int(), long(), float(). (Not to complex()!)Guido van Rossum-7/+127
2. Fix two bugs in complex(): - Memory leak when using complex(classinstance) -- r was never DECREF'ed. - Conversion of the second argument, if not complex, was done using the type vector of the 1st.
1997-03-11Define __debug__ as 0 if -O is given, 1 otherwise. Also test forGuido van Rossum-0/+4
errors in initializing the dictionary.
1997-02-14Changes for Lee Busby's SIGFPE patch set.Guido van Rossum-0/+2
New file pyfpe.c and exception FloatingPointError. Surround some f.p. operations with PyFPE macro brackets.
1997-02-14Added intern() function.Guido van Rossum-0/+14
1997-01-18Intern the string "__complex__".Guido van Rossum-1/+1
1996-12-10Add unistd.h to make gcc -Wall happy.Guido van Rossum-0/+4
1996-12-05Support __complex__ method on instances, for complex() conversion.Guido van Rossum-1/+23
Keep gcc -Wall happy.
1996-10-25New permission notice, includes CNRI.Guido van Rossum-12/+19
1996-10-16Forget about Ellipses b/w compatibility.Guido van Rossum-2/+0
1996-10-11Ellipses -> Ellipsis rename (the dictionary really says that it shouldGuido van Rossum-1/+3
be Ellipsis!). Bumped the API version because a linker-visible symbol is affected. Old C code will still compile -- there's a b/w compat macro. Similarly, old Python code will still run, builtin exports both Ellipses and Ellipsis.
1996-09-07Stupid bug: complex(x,y) would yield x+xjGuido van Rossum-1/+1
1996-08-16Don't die in resizestring() on filter(<func>, "").Guido van Rossum-1/+1
1996-08-08Include mymath.h instead of declaring prototypes for math functions.Guido van Rossum-5/+13
Fix leak and unchecked error in complex().
1996-07-30Add 'Ellipses' object.Guido van Rossum-0/+1
1996-07-30Changes for slice and ellipsesGuido van Rossum-0/+23
1996-07-21Py_complex; and WITHOUT_COMPLEX added to getargs.cGuido van Rossum-1/+1
1996-05-23Removed some redundant header includes.Guido van Rossum-5/+5
dir(object) now returns object.__dict__.keys() even if __dict__ is not a dictionary.
1996-04-09Add list() method, analogous to tuple().Guido van Rossum-0/+36
1996-01-26properly initialize optional arguments to apply()Guido van Rossum-1/+1
1996-01-12changes for complex numbersGuido van Rossum-1/+53
1995-08-04avoid resize of 0-length tupleGuido van Rossum-0/+5
1995-07-26be more suspicious of getlocals()Guido van Rossum-2/+8
1995-07-18keyword arguments and faster callsGuido van Rossum-6/+10
1995-07-10rename arglist to alist (conflict with new grammar symbol)Guido van Rossum-16/+16
1995-07-07added locals() and globals(); [raw_]input() uses readline()Guido van Rossum-1/+67
1995-02-18fix bogus test for negative floatGuido van Rossum-3/+3
1995-02-14call __import__() with 4 args instead of 1Guido van Rossum-1/+5
1995-02-10test for float to the float power hereGuido van Rossum-0/+5
1995-01-26moved callable() to object.cGuido van Rossum-29/+0
1995-01-20fix import related leaksGuido van Rossum-5/+1
1995-01-17fix Alpha bug in (x)range; different __builtins__ initializationGuido van Rossum-8/+14
1995-01-10fix subtle refcount big in filter() -- Tim MacKenzieGuido van Rossum-3/+6
1995-01-10move coerce() from bltinmodule.c to object.c and implement builtin_coerce() ↵Guido van Rossum-50/+7
differently