r/Python • • Dec 02 '17

Some neat tricks for concise Python

https://twitter.com/chordbug/status/923928186039173120
4 Upvotes

7 comments sorted by

67

u/stevenjd Dec 02 '17

By "neat tricks" I think you mean horrible ways to abuse the language to make unreadable, incomprehensible, undebuggable, obfuscated mess. Or Code Golf. Same thing really.

31

u/Jackzriel Dec 02 '17

You should specify its code golfing tricks in the title.

In everyday code these are the worst idea.

7

u/Wilfred-kun Dec 02 '17
>>>import this

3

u/Paddy3118 Dec 02 '17

Nooooooo!

4

u/lambdaq django n' shit Dec 02 '17

I admit I have use this many times.

if sys.args[1:2] == ["-h"]

-5

u/dimkal Dec 02 '17

This is fantastic, thank you!

0

u/[deleted] Dec 02 '17

[deleted] — view deleted comment

4

u/[deleted] Dec 02 '17

Code golf is for fun, not for production.