Source

pypy / pypy / interpreter / module.py

Author Commit Message Labels Comments Date
Amaury Forgeot d'Arc
The NUL byte is now disallowed in many posix functions. We use the annotator to "prove" that a string has no NUL.
Branches
string-NUL
Alex Gaynor
Make Module.w_dict as quasi-immut.
Amaury Forgeot d'Arc
getdict() now takes the 'space' as argument
Branches
getdict-signature
Alex Gaynor
Allow submodules for MixedModules, imported from my psycopg2 fork.
Branches
kqueue
Armin Rigo
Only add '__package__' to the names in modules created internally, but not in modules created from Python code, as in CPython.
Alex Gaynor
Module objects have an __package__ attribute, eventually this needs to be set/used by the imp module, but for now just expose it.
Armin Rigo
Attempt to fix the issue shown by test_appinterp:test_geninterp_can_unfreeze.
Alex Gaynor
Backed out changeset b73a7c56d7ac
Alex Gaynor
Support for submodules.
Branches
mixed-submodules
Amaury Forgeot d'Arc
"svn merge" lost some changes in these files, just copy them from the branch. Resetting startup_called to False is specially important, otherwise after reload(sys) we retrieve the state captured during translation...
Amaury Forgeot d'Arc
Merge the import-builtin branch: Builtin modules are now translated and compiled, but not necessarily imported by the interpreter. This may speed up startup times! space.getbuiltinmodule() is still the way to import/retrieve these modules. It is now possible to reload builtin modules. Like CPython, the module init function (MixedModule.startup) is called only once, the module dictionary is captured on first import and restored when reloading the module; this is different from .py modules, which execute the code again. The imp module has been rewritten at interplevel, and now shares its implementation with the __import__ function. -…
Amaury Forgeot d'Arc
Revert again my recent changes to the import system. There are other consequences, like the "imp" module which must be rewritten to correctly handle built-in modules. Let's do this on a branch. (reverted r69947, r69956, r69969, r70003)
Amaury Forgeot d'Arc
Change the way built-in modules are initialized and imported: (2nd attempt) - All built-in modules are inserted into space.builtin_modules when they are discovered, but not in sys.modules. - The end of space initialization calls setup_builtin_modules(), which calls mod.setup_after_space_initialization() for every module. At this stage, sys.modules contains the "sys" module, and other modules imported by mod.setup_after_space_initialization(). - The space and mod…
Amaury Forgeot d'Arc
Bah. revert r69900, which broke imports like from email.Parser import Parser
Amaury Forgeot d'Arc
Change the way built-in modules are initialized and imported: - All built-in modules are inserted into space.builtin_modules when they are discovered, but not in sys.modules. - The end of space initialization calls setup_builtin_modules(), which calls mod.setup_after_space_initialization() for every module. At this stage, sys.modules contains the "sys" module, and other modules imported by mod.setup_after_space_initialization(). - The space and mod…
Maciej Fijalkowski
Check-in merge attempt. Diff is to huge to read it.
Armin Rigo
Move the 'file' class to interp-level and remove the direct app-level interface to streams.
Michael Hudson-Doyle
remove the extremely-rarely-not-[] argument from the newdict operation.
Eric van Riet Paap
Merge picklesupport brancj back into the trunk.
Anders Chrigström
(pedronis, arre) Create a space helper for interning strings and use it for names, mostly in code objects. => Slight performace improvement in pystone and richards.
Michael Hudson-Doyle
suggestions from 'importfun' about interpreter: remove unused imports, change some imports to import from the module that defines the name, not some other module that also imports it.
Armin Rigo
Implemented the import lock when --usemodules=thread. The import lock itself is completely done at app-level in imp.py, to provide the required interface imp.*lock*() to user programs. It's done as an __import__ hook. There is a minor hack to force imp.py to get imported when the space is done being initialized. --This line, and those below, will be ignored-- M pypy/interpreter/baseobjspace.py M pypy/interpreter/module.py AM pypy/module/thread/test/test_import_lock.py M pypy/module/thread/__init__.py M pypy/objspace/std/objspace.py M pypy/lib/imp.py
Armin Rigo
Sanitized the __dict__ attribute of module objects, by giving up trying to emulate CPython's behavior of having __dict__ set to None if module.__init__ is not called, but changed to a real dict as soon as an attribute is stored into the module... Got rid of space.getdict() and space.getdictvalue() -- veeery old interface mostly used in descroperation.py only, now replaced by W_Root.getdict/value().
Samuele Pedroni
changes to pass test_module
Samuele Pedroni
fix wrap_exception_cls override use Module.__init__ directly in module __new__ (avoids subclasses __init__ that are NOT_RPYTHON and not indented to be called at runtime) sys2.__init__.Module.__init__ is NOT_RPYTHON
holger krekel
merge of the dist-interpapp branch where Samuele Armin and me worked for 9 days (summing up to a hundred commits, as you may have noticed in your inbox). Major results (apart from little stuff here and there) are: - a new app2interp mechanism that is now indepedent from the interp2app implementation - a new way to do "mixed modules" which contain applevel and interplevel definitions. We also ported the builtin and sys module and they now live as packages/directory structures. in pypy/module/sys2/__init__.py and pypy/module/builtin/__i…
Armin Rigo
Added a method 'ModuleType.__getattr__' that handles the special attributes sys.exc_{type,value,traceback}. It also gives a nicer error message for module attributes not found.
Olivier Dormond
Modules can have docstring at construction time.
Armin Rigo
Moved the branch back into the trunk.
Armin Rigo
Gateway cleanups: trying to remove interpreter-level ** arguments. Now interp2app(f) no longer accepts interp-level functions with **. Instead, the signature of f should either end with a * argument, or with an argument called __args__ (hum). In the latter case, the app-level version of f appears to have a * and a ** argument, and the interp-level version will get all that nicely collected in an pypy.interpreter.argument.Arguments instance. Hum, the goal was to…
  1. Prev
  2. 1
  3. 2
  4. Next