├── README.md └── license /README.md: -------------------------------------------------------------------------------- 1 | # Awesome Zen of Python [![Awesome](https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome) 2 | 3 | This is a collection of awesome resources related to 4 | [the Zen of Python (PEP 20)](https://www.python.org/dev/peps/pep-0020/) 5 | aka [The Python Way](https://mail.python.org/pipermail/python-list/1999-June/001951.html) 6 | by [Tim Peters](https://en.wikipedia.org/wiki/Tim_Peters_(software_engineer)) 7 | 8 | Beautiful is better than ugly. 9 | Explicit is better than implicit. 10 | Simple is better than complex. 11 | Complex is better than complicated. 12 | Flat is better than nested. 13 | Sparse is better than dense. 14 | Readability counts. 15 | Special cases aren't special enough to break the rules. 16 | Although practicality beats purity. 17 | Errors should never pass silently. 18 | Unless explicitly silenced. 19 | In the face of ambiguity, refuse the temptation to guess. 20 | There should be one-- and preferably only one:obvious way to do it. 21 | Although that way may not be obvious at first unless you're Dutch. 22 | Now is better than never. 23 | Although never is often better than *right* now. 24 | If the implementation is hard to explain, it's a bad idea. 25 | If the implementation is easy to explain, it may be a good idea. 26 | Namespaces are one honking great idea: let's do more of those! 27 | 28 | ### Articles 29 | * [Chaitanya Baweja: Contemplating the Zen of Python](https://medium.com/better-programming/contemplating-the-zen-of-python-186722b833e5) 30 | * [Radomir Dopieralski: Zen of Python Considered Harmful](http://sheep.art.pl/Zen%20of%20Python%20Considered%20Harmful) 31 | * [Aamir Farooq, Vadim Zaytsev: There Is More Than One Way to Zen Your Python](https://dl.acm.org/doi/10.1145/3486608.3486909) 32 | * [Jonathan M. Hammond: A Brief Analysis of “The Zen of Python”](https://medium.com/@Pythonidaer/a-brief-analysis-of-the-zen-of-python-2bfd3b76edbf) 33 | * [Abdur-Rahmaan Janhangeer: The Zen Of Python Is A Joke And Here Is Why](https://dev.to/abdurrahmaanj/the-zen-of-python-is-a-joke-and-here-is-why-you-should-not-take-it-too-seriously-508d) 34 | * [Abdur-Rahmaan Janhangeer: The Zen of Python: As Related by Masters](https://dev.to/abdurrahmaanj/the-zen-of-python-as-related-by-masters-1p9i) 35 | * [Dima Kotik: Application Security and the Zen of Python](https://www.securityjourney.com/post/application-security-and-the-zen-of-python) 36 | * [Łukasz Langa: Zen of Python, Again](https://lukasz.langa.pl/b6888f38-2e14-4595-a4fe-187fd0557a55/) 37 | * [Adrienne Lowe: The Zen of Python Teams: COVID-19 edition](https://leadingwithspoons.com/2020/07/15/the-zen-of-python-teams-covid-19-edition/) [(see also the talk)](https://www.youtube.com/watch?v=WZ8FEB4J8-c) 38 | * [Reinout van Rees: “Complex” and “complicated”](https://reinout.vanrees.org/weblog/2015/12/21/complex-complicated.html) 39 | * [Al Sweigart: The Zen of Python, Explained](https://inventwithpython.com/blog/2018/08/17/the-zen-of-python-explained/) 40 | * [Moshe Zadka: Meditations on the Zen of Python [that's summary, individual articles below]](https://orbifold.xyz/zen-of-python.html) 41 | * [Why your Python code needs to be beautiful and explicit](https://opensource.com/article/19/12/zen-python-beauty-clarity) 42 | * [Prioritizing simplicity in your Python code](https://opensource.com/article/19/12/zen-python-simplicity-complexity) 43 | * [Why your Python code should be flat and sparse](https://opensource.com/article/19/12/zen-python-flat-sparse) 44 | * [Making trade-offs when writing Python code](https://opensource.com/article/19/12/zen-python-trade-offs) 45 | * [How the Zen of Python handles errors](https://opensource.com/article/19/12/zen-python-errors) 46 | * [The importance of consistency in your Python code](https://opensource.com/article/19/12/zen-python-consistency) 47 | * [The Zen of Python: Why timing is everything](https://opensource.com/article/19/12/zen-python-timeliness) 48 | * [How to tell if implementing your Python code is a good idea](https://opensource.com/article/19/12/zen-python-implementation) 49 | * [Namespaces are the shamash candle of the Zen of Python](https://opensource.com/article/19/12/zen-python-namespaces) 50 | 51 | ### Talks 52 | * [Raymond Hettinger: Beyond PEP 8 -- Best practices for beautiful intelligible code](https://www.youtube.com/watch?v=wf-BqAjZb8M) 53 | * [Łukasz Langa: Life Is Better Painted Black](https://www.youtube.com/watch?v=esZLCuWs_2Y) 54 | * [Adrienne Lowe: The Zen of Python for Teams](https://www.youtube.com/watch?v=WZ8FEB4J8-c) [(see also the article)](https://leadingwithspoons.com/2020/07/15/the-zen-of-python-teams-covid-19-edition/) 55 | * [Justin Mayer: Zen of Python Dependency Management](https://www.youtube.com/watch?v=asL0dbN6pAY) 56 | * [Christopher Neugebauer: Practicality Beats Purity: The Zen of Python’s Escape Hatch?](https://youtu.be/XU9_3AlCy84) 57 | * [Rudolf Olah: Python as a philosophy](https://www.youtube.com/watch?v=zkjYOKLvZko) 58 | * [Kenneth Reitz: Python For Humans](https://www.youtube.com/watch?v=Y97D8j6CAog) 59 | 60 | ### Tools 61 | * [Black - The uncompromising Python code formatter](https://github.com/psf/black) 62 | * [Obey your Zen with wemake-python-styleguide](https://github.com/wemake-services/wemake-python-styleguide) 63 | 64 | ### Other 65 | * [Fundamental philosophies Django’s developers have used in creating the framework](https://docs.djangoproject.com/en/dev/misc/design-philosophies/) 66 | * [Yannis Rizos: Is the 14th line of The Zen of Python a reference to Dijkstra? (stackoverflow answer)](https://softwareengineering.stackexchange.com/a/148794) 67 | * [Bug #3364: I'm afraid you missed the joke](https://bugs.python.org/issue3364) 68 | 69 | ###### And now for something completely different 70 | * [import that](https://github.com/pydanny/that) 71 | * [PEP 8 song, written and performed by Leon Sandøy, A.K.A. lemonsaurus; music and melody from Mad World by Roland Orzabal](https://www.youtube.com/watch?v=hgI0p1zf31k) 72 | * [Zen of git](https://tdhopper.com/blog/zen-of-git/) 73 | * [Zen of Python song, lyrics by Tim Peters 1999, music and arrangement by Barry Warsaw 2020](https://www.youtube.com/watch?v=i6G6dmVJy74) 74 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | CC0 1.0 Universal 2 | 3 | Statement of Purpose 4 | 5 | The laws of most jurisdictions throughout the world automatically confer exclusive Copyright and Related Rights (defined below) upon the creator and subsequent owner(s) (each and all, an "owner") of an original work of authorship and/or a database (each, a "Work"). 6 | 7 | Certain owners wish to permanently relinquish those rights to a Work for the purpose of contributing to a commons of creative, cultural and scientific works ("Commons") that the public can reliably and without fear of later claims of infringement build upon, modify, incorporate in other works, reuse and redistribute as freely as possible in any form whatsoever and for any purposes, including without limitation commercial purposes. These owners may contribute to the Commons to promote the ideal of a free culture and the further production of creative, cultural and scientific works, or to gain reputation or greater distribution for their Work in part through the use and efforts of others. 8 | 9 | For these and/or other purposes and motivations, and without any expectation of additional consideration or compensation, the person associating CC0 with a Work (the "Affirmer"), to the extent that he or she is an owner of Copyright and Related Rights in the Work, voluntarily elects to apply CC0 to the Work and publicly distribute the Work under its terms, with knowledge of his or her Copyright and Related Rights in the Work and the meaning and intended legal effect of CC0 on those rights. 10 | 11 | Copyright and Related Rights. A Work made available under CC0 may be protected by copyright and related or neighboring rights ("Copyright and Related Rights"). Copyright and Related Rights include, but are not limited to, the following: 12 | i. the right to reproduce, adapt, distribute, perform, display, communicate, and translate a Work; 13 | 14 | ii. moral rights retained by the original author(s) and/or performer(s); 15 | 16 | iii. publicity and privacy rights pertaining to a person's image or likeness depicted in a Work; 17 | 18 | iv. rights protecting against unfair competition in regards to a Work, subject to the limitations in paragraph 4(a), below; 19 | 20 | v. rights protecting the extraction, dissemination, use and reuse of data in a Work; 21 | 22 | vi. database rights (such as those arising under Directive 96/9/EC of the European Parliament and of the Council of 11 March 1996 on the legal protection of databases, and under any national implementation thereof, including any amended or successor version of such directive); and 23 | 24 | vii. other similar, equivalent or corresponding rights throughout the world based on applicable law or treaty, and any national implementations thereof. 25 | 26 | Waiver. To the greatest extent permitted by, but not in contravention of, applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and unconditionally waives, abandons, and surrenders all of Affirmer's Copyright and Related Rights and associated claims and causes of action, whether now known or unknown (including existing as well as future claims and causes of action), in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each member of the public at large and to the detriment of Affirmer's heirs and successors, fully intending that such Waiver shall not be subject to revocation, rescission, cancellation, termination, or any other legal or equitable action to disrupt the quiet enjoyment of the Work by the public as contemplated by Affirmer's express Statement of Purpose. 27 | 28 | Public License Fallback. Should any part of the Waiver for any reason be judged legally invalid or ineffective under applicable law, then the Waiver shall be preserved to the maximum extent permitted taking into account Affirmer's express Statement of Purpose. In addition, to the extent the Waiver is so judged Affirmer hereby grants to each affected person a royalty-free, non transferable, non sublicensable, non exclusive, irrevocable and unconditional license to exercise Affirmer's Copyright and Related Rights in the Work (i) in all territories worldwide, (ii) for the maximum duration provided by applicable law or treaty (including future time extensions), (iii) in any current or future medium and for any number of copies, and (iv) for any purpose whatsoever, including without limitation commercial, advertising or promotional purposes (the "License"). The License shall be deemed effective as of the date CC0 was applied by Affirmer to the Work. Should any part of the License for any reason be judged legally invalid or ineffective under applicable law, such partial invalidity or ineffectiveness shall not invalidate the remainder of the License, and in such case Affirmer hereby affirms that he or she will not (i) exercise any of his or her remaining Copyright and Related Rights in the Work or (ii) assert any associated claims and causes of action with respect to the Work, in either case contrary to Affirmer's express Statement of Purpose. 29 | 30 | Limitations and Disclaimers. 31 | 32 | a. No trademark or patent rights held by Affirmer are waived, abandoned, surrendered, licensed or otherwise affected by this document. 33 | 34 | b. Affirmer offers the Work as-is and makes no representations or warranties of any kind concerning the Work, express, implied, statutory or otherwise, including without limitation warranties of title, merchantability, fitness for a particular purpose, non infringement, or the absence of latent or other defects, accuracy, or the present or absence of errors, whether or not discoverable, all to the greatest extent permissible under applicable law. 35 | 36 | c. Affirmer disclaims responsibility for clearing rights of other persons that may apply to the Work or any use thereof, including without limitation any person's Copyright and Related Rights in the Work. Further, Affirmer disclaims responsibility for obtaining any necessary consents, permissions or other rights required for any use of the Work. 37 | 38 | d. Affirmer understands and acknowledges that Creative Commons is not a party to this document and has no duty or obligation with respect to this CC0 or use of the Work. 39 | 40 | For more information, please see http://creativecommons.org/publicdomain/zero/1.0 41 | --------------------------------------------------------------------------------