Transición de Python 2 a Python 3 y PEPs esenciales

Clase 48 de 49Curso Práctico de Python: Creación de un CRUD

Resumen

No es recomendable empezar con Python 2 porque tiene fecha de vencimiento para el próximo año.

PEP = Python Enhancement Proposals

Los PEP son la forma en la que se define como avanza el lenguaje. Existen tres PEPs que debes saber.

  • PEP8 es la guía de estilo de cómo escribir programas de Python. Es importante escribir de manera similiar para que nuestro software sea legible para el resto de la comunidad
  • PEP257 nos explica cómo generar buena documentación en nuestro código
  • PEP20
import this

The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!