Nick Coghlan <[EMAIL PROTECTED]> added the comment:

I personally wonder if we should be moving towards a more systematic
means of identifying the underlying Python VM than the current fairly ad
hoc use of sys.platform.

By that I mean adding another sys attribute (e.g. sys.vm) which could be
checked explicitly for the Python VM identity, rather than the
underlying platform.

E.g.

CPython: sys.vm == "cpython"
Jython:  sys.vm == "jython"
PyPy:  sys.vm == "pypy"
IronPython:  sys.vm == "ironpython"

Then instead of relying on a separate flag in test_support the
impl_detail decorator could be written based on the VM names:

def impl_detail(*vm_names):
  if not vm_names:
    vm_names = "cpython",
  if sys.vm in vm_names:
    # Test the implementation detail
  else:
    # Skip this test

Depending on how ambitious an implementer of an alternative VM wants to
be, they could either set sys.vm to the same value as one of the
existing interpreters and try to match the implementation details as
well as the language spec, or else use their own name.

----------
nosy: +ncoghlan

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4242>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to