Skip to content

trag1c/mcoding-all-dunders

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mCoding All Dunders Video

Contributing

If you'd like to add a code example, make sure it has not already been done or is in progress (see the spreadsheet or the Issues tab for reference). Once you have confirmed that, open an issue for the dunder(s) you'd like to add examples for. When you're done, simply make a PR!

Each PR is required to have 3 approving reviews in order to be merged, and anyone is free to review, so your approval counts!

Submission guidelines

  • The code has to be PEP8-compliant and lines must be at most 80 chars long
  • Typehints are not necessary (unless needed for the example to work)
  • Be consistent about typehints: either do them properly or don't include them at all
  • Examples can include multiple dunders if they go together
  • The code should be a minimal working example that uses the dunder(s)

When submitting code for the __cool_dunder__ dunder, name the file cool_dunder.py (basically strip the underlines). When submitting multiple dunders in one example, you can:

  • use the dunder name that's the most important/widely used, e.g. name.py when adding __name__ and __qualname__
  • use a name that easily describes all of them, e.g. comparisons.py when adding __gt__, __le__, etc.

The file should be put in the corresponding folder inside src, e.g. a __post_init__ example should be located in src/library-lagoon/post_init.py (see categories in the spreadsheet).

Your code must pass CI. To check if your code will pass CI locally run these commands:

pip install -r requirements.txt
black --check .
ruff check .

You can also apply fixes if these checks don't pass:

black .
ruff check . --fix

Credits

People who have contributed at least 1 dunder or have reviewed at least 2 PRs are eligible for the Volunteer role on the mCoding server.

Big thanks to everybody who contributed with code examples or code reviews:

About

Code examples for mCoding's all dunders video

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages