2. What is faster?
# for inside function
def main():
for i in xrange(10**8):
pass
main()
# for outside function
for i in xrange(10**8):
pass
3. What..?!
# for inside function
def main():
for i in xrange(10**8):
pass
main()
real 0m1.841s
user 0m1.828s
sys 0m0.012s
# for outside function
for i in xrange(10**8):
pass
real 0m4.543s
user 0m4.524s
sys 0m0.012s
6. Why to contribute?
● It is good to know what’s inside the blackbox
you use everyday for work
● cPython is open source, and needs
contributors to keep on
● Great opportunity to improve your coding skills
● Make the world better – even if mainly
programmers are benefited ;)
7. Before we get to cPython itself
● Read the docs:
http://docs.python.org/devguide/
● Install Mercurial:
http://mercurial.selenic.com/
8. Get the source!
hg clone http://hg.python.org/cpython
● Only ~ 276.5 MB
● If your connection is ~13.Mpbs, it won’t take
more than 3 min to download the source-code
9. Building cPython
$ cd cpython
$ ./configure --with-pydebug && make -j2
This gave me:
(...)
Python build finished, but the necessary bits to
build these modules were not found:
_gdbm ossaudiodev spwd
To find the necessary bits, look in setup.py in
detect_modules() for the module's name.
13. Tips on issues
● start looking for easy issues
● don’t be rude, check if the issue was already assigned
and if there is someone else working on it
● let people know you’ll be working on an issue – just
comment on it (thanks Sean Reifschneider for the tip)
● if you’ll work on a bug, make sure you can reproduce it
● don’t forget to write tests for new code and updating
documentation, if needed
14. Issues I already played around
Where I was successful:
● zipimport: http://bugs.python.org/issue8942
● fileinput: http://bugs.python.org/issue5758
And weren't so successful:
● several ;)
15. Thanks for the review
R. David Murray during PyCon US 2012