0
0
mirror of https://github.com/python/cpython.git synced 2024-11-28 16:45:42 +01:00
cpython/Python
Guido van Rossum aee0bad0a5 First part of package support.
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-09-05 07:33:22 +00:00
..
atof.c
bltinmodule.c First part of package support. 1997-09-05 07:33:22 +00:00
ceval.c First part of package support. 1997-09-05 07:33:22 +00:00
compile.c Cprrect stuoid tyops -- was comparing variabes with themselves because 1997-08-29 17:12:43 +00:00
dup2.c
errors.c PyErr_NoMemory(): If the pre-instantiated memory exception is non-null 1997-08-29 21:54:35 +00:00
fmod.c
frozen.c Oops -- this contains frozen bytecode, but it was Python 1.4 bytecode! 1997-07-19 21:54:24 +00:00
frozenmain.c Keep gcc -Wall happy 1997-08-15 02:52:08 +00:00
getargs.c
getcompiler.c Make it return a _const_ char*. 1997-07-19 19:48:41 +00:00
getcopyright.c
getcwd.c
getmtime.c First part of package support. 1997-09-05 07:33:22 +00:00
getopt.c
getplatform.c Make it return a _const_ char*. 1997-07-19 19:48:41 +00:00
getversion.c Make it return a _const_ char*. 1997-07-19 19:48:41 +00:00
graminit.c
hypot.c
import.c First part of package support. 1997-09-05 07:33:22 +00:00
importdl.c set sharedlib extensions properly for NeXT (Ted Horst) 1997-08-16 14:38:09 +00:00
importdl.h First part of package support. 1997-09-05 07:33:22 +00:00
Makefile.in frozenmain.c is now also in the library, 1997-07-19 21:59:47 +00:00
marshal.c Plugged a leak. (The same as the one plugged in compile.c -- forgot 1997-07-26 23:30:18 +00:00
memmove.c
modsupport.c Removed fatal errors from Py_Initmodule4() (and thus from 1997-08-02 03:07:46 +00:00
mystrtoul.c
pyfpe.c
pystate.c Added missing newline to warning msg 1997-08-21 02:28:19 +00:00
pythonmain.c
pythonrun.c Two independent changes (oops): 1997-08-29 22:32:42 +00:00
sigcheck.c
strdup.c
strerror.c
strtod.c
structmember.c
sysmodule.c Remove unised variable 1997-08-07 19:22:48 +00:00
thread_cthread.h
thread_foobar.h
thread_lwp.h
thread_nt.h Use _beginthread() and _endthread() in favor of CreateThread() and 1997-08-14 20:12:58 +00:00
thread_os2.h
thread_pthread.h
thread_sgi.h
thread_solaris.h
thread.c
traceback.c