What parts of the sys modules does PyPy implement?

A discussion of what parts of the sys module various VMs should be expected to implement has come up on python-dev. I am hoping someone here can let me know what PyPy currently implements. - argv - byteorder - path, path_hooks, meta_path, path_importer_cache, and modules - copyright, hexversion, version, and version_info - displayhook, __displayhook__ - excepthook, __excepthook__, exc_info, and exc_clear - exec_prefix and prefix - executable - exit - flags, py3kwarning, dont_write_bytecode, and warn_options - getfilesystemencoding - get/setprofile - get/settrace, call_tracing - getwindowsversion - maxint and maxunicode - platform - ps1 and ps2 - stdin, stderr, stdout, __stdin__, __stderr__, __stdout__ - tracebacklimit - get/setrecursionlimit - get/setcheckinterval - _getframe and _current_frame - getrefcount - get/setdlopenflags - settscdumps - api_version - winver - dllhandle - float_info - _compact_freelists - _clear_type_cache - subversion - builtin_module_names - callstats - intern -Brett

Hi, On Tue, Apr 8, 2008 at 7:51 PM, Brett Cannon <brett@python.org> wrote:
I've made a comparison between python2.4 sys module and the one in pypy, it's really simple and I'm not sure that all the others features are implemented and working as expected, but I hope it helps. This are the features from 2.4 sys that are not present in PyPy's sys: - exc_type - getdlopenflags - getrefcount - pydebug - setdlopenflags -- Bruno Fialho Marques Gola <brunogola@gmail.com> http://www.brunogola.com.br Cel: (11) 9294-5883

Hi Bruno, On Tue, Apr 08, 2008 at 08:15:29PM -0300, Bruno Gola wrote:
This are the features from 2.4 sys that are not present in PyPy's sys: - exc_type
Actually, exc_type, exc_value and exc_traceback are present in PyPy's sys module but they are not in sys.__dict__. There is a __getattr__ handler on the sys module that provides these attributes in a thread-safe way.
- pydebug
Where does this come from? It is not in my Python 2.4 either. A bientot, Armin.

Hi Brett, On Tue, Apr 08, 2008 at 03:51:58PM -0700, Brett Cannon wrote:
PyPy implements the attributes that existed in 2.4 already. We haven't decided anything about the newer attributes but I guess they will be added as we upgrade. Here is the justification for the few 2.4 attributes that are missing (mentioned by Bruno) and the post-2.4 attributes that maybe we will not implement when we upgrade.
- exec_prefix and prefix
These ones are stubs at the moment. We haven't thought much about what they should contain and how to install PyPy's standard library in a way that applications like distutils will find it.
- getfilesystemencoding
No support for file system encoding yet.
Not much support for Windows-specific features. Should probably be improved over time.
- getrefcount
Makes only sense in CPython.
- get/setdlopenflags - api_version
No support for loading separately-compiled extension modules in PyPy so far.
- settscdumps - callstats
I think these are ways to access internal performance counters of ceval.c.
- _compact_freelists - _clear_type_cache
Looks very much like internal details of CPython. A bientot, Armin.

Hi, On Tue, Apr 8, 2008 at 7:51 PM, Brett Cannon <brett@python.org> wrote:
I've made a comparison between python2.4 sys module and the one in pypy, it's really simple and I'm not sure that all the others features are implemented and working as expected, but I hope it helps. This are the features from 2.4 sys that are not present in PyPy's sys: - exc_type - getdlopenflags - getrefcount - pydebug - setdlopenflags -- Bruno Fialho Marques Gola <brunogola@gmail.com> http://www.brunogola.com.br Cel: (11) 9294-5883

Hi Bruno, On Tue, Apr 08, 2008 at 08:15:29PM -0300, Bruno Gola wrote:
This are the features from 2.4 sys that are not present in PyPy's sys: - exc_type
Actually, exc_type, exc_value and exc_traceback are present in PyPy's sys module but they are not in sys.__dict__. There is a __getattr__ handler on the sys module that provides these attributes in a thread-safe way.
- pydebug
Where does this come from? It is not in my Python 2.4 either. A bientot, Armin.

Hi Brett, On Tue, Apr 08, 2008 at 03:51:58PM -0700, Brett Cannon wrote:
PyPy implements the attributes that existed in 2.4 already. We haven't decided anything about the newer attributes but I guess they will be added as we upgrade. Here is the justification for the few 2.4 attributes that are missing (mentioned by Bruno) and the post-2.4 attributes that maybe we will not implement when we upgrade.
- exec_prefix and prefix
These ones are stubs at the moment. We haven't thought much about what they should contain and how to install PyPy's standard library in a way that applications like distutils will find it.
- getfilesystemencoding
No support for file system encoding yet.
Not much support for Windows-specific features. Should probably be improved over time.
- getrefcount
Makes only sense in CPython.
- get/setdlopenflags - api_version
No support for loading separately-compiled extension modules in PyPy so far.
- settscdumps - callstats
I think these are ways to access internal performance counters of ceval.c.
- _compact_freelists - _clear_type_cache
Looks very much like internal details of CPython. A bientot, Armin.
participants (3)
-
Armin Rigo
-
Brett Cannon
-
Bruno Gola