DEV Community

loading...

Discussion on: Are one liners always pythonic?

Collapse
chrisgreening profile image
Chris Greening

I've kind of gotten a feel for what makes sense and what doesn't and this translates to readability for others as well. If the one-liner is longer than 79 characters that's usually a red flag and I always break my statements up as much as possible before introducing a complicated one liner. They usually end up reading more like pseudo code than anything too wild

I will admit I've gotten lazy though and written crazy one liners for throwaway programs or programs under time constraint and will return months later and have trouble reading my own code lol

Thread Thread
miguelmj profile image
MiguelMJ Author

That's one useful link!