Python Forum

Full Version: features examples by release
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I develop Python features examples by release:
https://github.com/makelinux/examples/bl.../README.md

Most valuable features of each python release are demonstrated in separated file with unit testing. For example https://github.com/makelinux/examples/bl...hon/3.5.py demonstrates features of Python 3.5.

Welcome to review, use and update.
How your examples are better than the one in the official docs? I know that not every new method has an example, but it's not always necessary.
Some problems that need to be fixed:
star imports
single-char variable names
e.g. in 3.9 you overwrite the built-in sum function, probably similar mistake is present elsewhere.
no documentation/explanations (i.e. only link to official docs, which again brings to the question why and what's benefit compared to docs)
imports at the end of file - I understand what you do, but you should not relay on executing passed module during the import, that's bad design
just importing new modules, how does demonstrate the new features in them?
Thank you for the feedback!

I've fixed the code accordingly all your notes.

(Aug-31-2020, 04:31 AM)buran Wrote: [ -> ]How your examples are better than the one in the official docs?

Features of examples:
  • Minimal and practical self descriptive as possible source code.
  • Complete and ready to copy-paste into an application.
  • Runnable in-place. (No need to copy paste snippets from documentation into an interpreter)
  • Verifiable. Internal tests provides reliability and durability. You can easily add new features and run tests to assure code validity.