-
Notifications
You must be signed in to change notification settings - Fork 0
Contributing
PunyPython accepts contributions that add new Python examples, fix errors, or improve comments. All new content must remain Python-only and educational in purpose.
- This is a Python-only repo. No other languages.
- All content must be released under CC BY-SA 3.0. No proprietary content.
- Every file must be runnable with a standard Python 3 install — one exception currently exists (
factorial_numpy_module.py, which requires numpy and is explicitly labelled). New third-party dependencies are strongly discouraged; discuss before adding.
Follow the commenting philosophy already established:
- Rudimentary scripts: comments label what each line does.
- Intermediate scripts: comments explain why — pitfalls, gotchas, idiom choices.
- Advanced scripts: comments explain when to use a technique and what the trade-offs are.
All examples are written as expressions with # => result comments and/or print() calls. Do not add import unittest test harnesses — keep files instructional, not test suites.
Files in LearnXinY/ follow a specific header format:
# <filename>.py # <one-line description of topic> # Source: https://learnxinyminutes.com/python/ (CC BY-SA 3.0) # Organization inspired by learnxinyminutes.com
Original supplemental examples go in a clearly marked block at the bottom:
# ----------------------------------------------------------------------- # ORIGINAL EXAMPLES (co-authored with Claude) # -----------------------------------------------------------------------
Include up to two original examples per concept. Each example must carry an inline comment explaining when or why — not just what.
Place new files inside the appropriate problem folder (e.g. Arrays/rotate/). Name the file descriptively: rotate_array_<approach>.py. Include a docstring or header comment explaining the algorithm and its time/space complexity if non-obvious.
If you are adding a new problem category (e.g. Graphs/), open a PR with a brief description of what problem it covers and why it fits the repo. The README structure tree will need updating.
- Fork the repo and create a branch with a short descriptive name.
- Add or modify files. Do not add
.DS_Store,__pycache__/, or IDE config files. - Verify all new files run without error:
python <file.py>. - Open a PR with a description of what was added and why.
Every new file should carry a short license comment at the top:
# CC BY-SA 3.0 — https://creativecommons.org/licenses/by-sa/3.0/Or, for LearnXinY files, the full attribution header shown above.