DEV Community

Discussion on: How would you rewrite this Python code?

Collapse
yorodm profile image
Yoandy Rodriguez Martinez • Edited on

I'll tell you as my old Python sensei used to tell me: When in doubt, import this.
I think your second solution is the one. It is both concise and does not messes with PEP 8.

Collapse
cathodion profile image
Dustin King Author

What do you mean by "import this"?

Collapse
pbouillon profile image
Pierre Bouillon

Just type "import this" I'm your interpreter, you will understand :)

Thread Thread
cathodion profile image
Dustin King Author

Ah yes, the good ol' Zen of Python.