Skip to content

Navigation Menu

Sign in
Sign up

Contributing

Quadstronaut edited this page Jun 7, 2026 · 1 revision

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.

Before you start

  • 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.

Code style

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.

Adding to LearnXinY

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.

Adding algorithm approaches

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.

Adding a new problem folder

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.

Pull requests

  1. Fork the repo and create a branch with a short descriptive name.
  2. Add or modify files. Do not add .DS_Store, __pycache__/, or IDE config files.
  3. Verify all new files run without error: python <file.py>.
  4. Open a PR with a description of what was added and why.

License header

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.

Clone this wiki locally

AltStyle によって変換されたページ (->オリジナル) /