0

pypy

has many built-in function use python implementation.example:link

but,i can't find model 'sys' implementation.

how can i get it.

import sys
print help(sys)
asked Jan 10, 2010 at 7:01
1
  • source of which function do you want from sys? Commented Jan 10, 2010 at 8:24

2 Answers 2

2

The sys module is implemented in C: http://svn.python.org/view/python/trunk/Python/sysmodule.c?view=markup

There is no Python source for it, because it's entirely operating system interfaces that cannot be implemented in pure Python.

answered Jan 10, 2010 at 9:16
Sign up to request clarification or add additional context in comments.

1 Comment

sys provides functions crucial to the interpreter, and is really more of a reflection of interpreter state, so it is actually compiled in when the interpreter is built, and the values are all guaranteed to change at runtime. Pypy would have to use their own implementation of sys.
0

Abstraction can only be taken so far, Python strives to be a system/platform independent language and the sys module being what it is has to be platform specific and cannot be implemented in pure python.

answered Jan 10, 2010 at 10:26

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.