summaryrefslogtreecommitdiffstats
path: root/Python/bltinmodule.c
Commit message (Collapse)AuthorAgeFilesLines
* Need a cast when comparing type object in isinstance()Guido van Rossum1997-12-101-1/+1
|
* Support type objects in isinstance().Guido van Rossum1997-12-021-10/+15
| | | | | E.g. isinstance('',types.StringType) will return true now instead of raising a TypeError exception. This is for JPython compatibility.
* Release interpreter lock around readline call in [raw_]input().Guido van Rossum1997-09-261-0/+2
|
* initerrors(): Eliminate circular reference which was causing a smallBarry Warsaw1997-09-181-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! :-)
* [Py_Exc]NumberError => [Py_Exc]ArithmeticErrorBarry Warsaw1997-09-161-7/+7
|
* Introduce PyExc_Exception as the conceptual root class for all exceptions.Guido van Rossum1997-09-161-0/+7
|
* First part of package support.Guido van Rossum1997-09-051-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!
* Removed obsolete exception PyExc_AccessError.Barry Warsaw1997-08-291-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.
* Two new built-in functions: issubclass() and isinstance(). Both takeBarry Warsaw1997-08-221-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.
* The last of the mass checkins for separate (sub)interpreters.Guido van Rossum1997-08-021-50/+71
| | | | | | | Everything should now work again. See the comments for the .h files mass checkin (e.g. pystate.h) for more detail.
* PyObject_Compare can raise an exception now.Guido van Rossum1997-05-231-4/+14
|
* Oops -- missed FloatingPointError in renaming.Guido van Rossum1997-05-091-2/+2
|
* Instead of importing graminit.h whenever one of the three grammar 'root'Guido van Rossum1997-05-071-7/+6
| | | | symbols is needed, define these in Python.h with a Py_ prefix.
* New dir() function --Guido van Rossum1997-05-061-22/+48
| | | | | | - uses abstract interface where possible - uses __members__ and __methods__ - returns [] when an object has no info available
* Avoid sprintf buffer overflow if more than 9999 arguments.Guido van Rossum1997-04-301-1/+1
|
* Quickly renamed the remaining files -- this directory is done.Guido van Rossum1997-04-291-662/+677
|
* Keep gcc -Wall and Microsoft VC happy.Guido van Rossum1997-04-111-3/+5
|
* 1. Add string conversions to int(), long(), float(). (Not to complex()!)Guido van Rossum1997-03-311-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.
* Define __debug__ as 0 if -O is given, 1 otherwise. Also test forGuido van Rossum1997-03-111-0/+4
| | | | errors in initializing the dictionary.
* Changes for Lee Busby's SIGFPE patch set.Guido van Rossum1997-02-141-0/+2
| | | | | New file pyfpe.c and exception FloatingPointError. Surround some f.p. operations with PyFPE macro brackets.
* Added intern() function.Guido van Rossum1997-02-141-0/+14
|
* Intern the string "__complex__".Guido van Rossum1997-01-181-1/+1
|
* Add unistd.h to make gcc -Wall happy.Guido van Rossum1996-12-101-0/+4
|
* Support __complex__ method on instances, for complex() conversion.Guido van Rossum1996-12-051-1/+23
| | | | Keep gcc -Wall happy.
* New permission notice, includes CNRI.Guido van Rossum1996-10-251-13/+20
|
* Forget about Ellipses b/w compatibility.Guido van Rossum1996-10-161-2/+0
|
* Ellipses -> Ellipsis rename (the dictionary really says that it shouldGuido van Rossum1996-10-111-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.
* Stupid bug: complex(x,y) would yield x+xjGuido van Rossum1996-09-071-1/+1
|
* Don't die in resizestring() on filter(<func>, "").Guido van Rossum1996-08-161-1/+1
|
* Include mymath.h instead of declaring prototypes for math functions.Guido van Rossum1996-08-081-5/+13
| | | | Fix leak and unchecked error in complex().
* Add 'Ellipses' object.Guido van Rossum1996-07-301-0/+1
|
* Changes for slice and ellipsesGuido van Rossum1996-07-301-0/+23
|
* Py_complex; and WITHOUT_COMPLEX added to getargs.cGuido van Rossum1996-07-211-1/+1
|
* Removed some redundant header includes.Guido van Rossum1996-05-231-5/+5
| | | | | dir(object) now returns object.__dict__.keys() even if __dict__ is not a dictionary.
* Add list() method, analogous to tuple().Guido van Rossum1996-04-091-0/+36
|
* properly initialize optional arguments to apply()Guido van Rossum1996-01-261-1/+1
|
* changes for complex numbersGuido van Rossum1996-01-121-1/+53
|
* avoid resize of 0-length tupleGuido van Rossum1995-08-041-0/+5
|
* be more suspicious of getlocals()Guido van Rossum1995-07-261-2/+8
|
* keyword arguments and faster callsGuido van Rossum1995-07-181-6/+10
|
* rename arglist to alist (conflict with new grammar symbol)Guido van Rossum1995-07-101-16/+16
|
* added locals() and globals(); [raw_]input() uses readline()Guido van Rossum1995-07-071-1/+67
|
* fix bogus test for negative floatGuido van Rossum1995-02-181-3/+3
|
* call __import__() with 4 args instead of 1Guido van Rossum1995-02-141-1/+5
|
* test for float to the float power hereGuido van Rossum1995-02-101-0/+5
|
* moved callable() to object.cGuido van Rossum1995-01-261-29/+0
|
* fix import related leaksGuido van Rossum1995-01-201-5/+1
|
* fix Alpha bug in (x)range; different __builtins__ initializationGuido van Rossum1995-01-171-8/+14
|
* fix subtle refcount big in filter() -- Tim MacKenzieGuido van Rossum1995-01-101-3/+6
|
* move coerce() from bltinmodule.c to object.c and implement builtin_coerce() ↵Guido van Rossum1995-01-101-50/+7
| | | | differently