Os dejo una de las charlas de la PyCon 15 (internacional), hablando sobre código bello, buenas prácticas, PEP 8 como la guía de estilo general de Python e ir más allá en la problemática P vs NP: pythónico vs no pythónico.
No sé si habíais leído esto, pero Python 8 (la próxima versión de Python no será 4 sino 8) sólo permitirá importar módulos que cumplan con PEP8[1]:
The PSF is happy to announce that the new Python release will be
Python 8!Why the version 8? It’s just to be greater than Perl 6 and PHP 7, but
it’s also a mnemonic for PEP 8. By the way, each minor release will now
multiply the version by 2. With Python 8 released in 2016 and one
release every two years, we will beat Firefox 44 in 2022 (Python 64) and
Windows 2003 in 2032 (Python 2048).A major release requires a major change to justify a version bump: the
new killer feature is that it’s no longer possible to import a module
which does not respect the PEP 8. It ensures that all your code is pure.
[1]: https://mail.python.org/pipermail/python-dev/2016-March/143603.html
eehhhmmm… WTF!?
Leed el enlace quien se haya quedado con dudas sobre si es en serio o no.
Mar 31 17:40:46 EDT 2016
Alguien se adelantó al April’s Fools.
Sufrid, por momentos habíais pensando que era cierto.
Al revés, yo casi disfrutaría, que soy fan del código limpito .
Con getter/setter obtienes/actualizas valores de atributos mediante la llamada a un método de objeto.
La definición de propiedades hace una llamada implícita a un método también en la obtención/actualización pero tratas el atributo como tal y no como una función.
No sé si me explico, pero aquí seguro que sí: