Manufactura industrial
Internet industrial de las cosas | Materiales industriales | Mantenimiento y reparación de equipos | Programación industrial |
home  MfgRobots >> Manufactura industrial >  >> Industrial programming >> python

El Zen de Python (pep-20 easter egg)

Uno de los primeros estímulos de Python es PEP-20. Es una lista de 19 tesis relacionadas con la programación de Python llamada "El Zen de Python". Estas reglas datan de 2004 y, a su vez, se basan en PEP-8.

Un pequeño huevo de Pascua que ha estado presente en Python durante mucho tiempo enumera estas 19 reglas:

>>> 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!

Entonces, siempre que tenga un REPL de Python, ¡puede obtener estas reglas en su pantalla!


python

  1. Tipos de datos de Python
  2. Operadores de Python
  3. Lista de Python
  4. Tupla de Python
  5. Diccionario de Python
  6. ¿Cómo podemos obtener una mejor imagen del IoT?
  7. Zen y el arte del mantenimiento automático del automóvil
  8. Construyendo mejores cadenas de suministro para el futuro
  9. Búsqueda de lo desconocido:mejor hacerlo juntos
  10. El software de B&R aprovecha mejor el potencial de los robots
  11. Cinco formas en que IoT cambió HVAC para mejor