[pypy-dev] Question about "Completing 'os' module" (issue 833)

Amaury Forgeot d'Arc amauryfa at gmail.com
Sun Aug 21 22:20:03 CEST 2011


Hello,

2011/8/21 Mitchell Hashimoto <mitchell.hashimoto at gmail.com>

> I noticed the 'os' module is incomplete, and I'd like to help complete
> this.
>

You are very welcome!


> CPython does this by simply having these methods available on "posix" "nt"
> "os2" etc. and the "os" module imports those. It appears that PyPy does the
> same thing. I was able to successfully add 'getlogin' as practice, but I
> wanted to post here before going further. Some questions below:
>
> 1.) Should I mimic CPython and add the functionality to the OS-specific
> modules?
>

Yes we should mimic CPython: fortunately these modules have different names
but share the same source file.
With CPython it's Modules/posixmodule.c, with PyPy it's in
pypy/module/posix.


> 2.) I don't have a Windows computer on hand. What is the standard practice
> for implementing some stdlib for one OS but not the other? Would PyPy accept
> this temporarily?
>

Yes, no problem. In this case, I think it's best to let the test fail on
Windows so that someone may notice and fix it.


> 3.) There are many missing methods, to simplify implementation time and the
> patch, would it be okay to submit a patch for each stdlib method, so that
> this was built up over time?
>

Yes, smaller patches are easier to read and merge. I'd be happy to review
and commit them.

-- 
Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20110821/28ac646e/attachment.html>


More information about the pypy-dev mailing list