Post number #788393, ID: 736cd2
|
Let's start with a question: What does "it's more pythonic" mean when learning the language?
I've seen and heard it a few times when learning about things like type suggestions, list comprehensions and class definitions. When compared with other structures in python, it boils down to "both are valid, but this one is more pythonic, and this one is more common in other languages, so you can use it for clarity".
Post number #788397, ID: 66a05c
|
https://dilbert.com/strip/2019-06-26
Post number #788437, ID: be064e
|
>>788397 Yeah funny. So what's the deal here?
Post number #788443, ID: 66a05c
|
as far as i can tell it's yet another shitty synonim for idiomatic / native to language
so i belive the basic deffinition would be: a diffrent usually shorter and more abstract way of acomplishing the same thing
Post number #788445, ID: 66a05c
|
for further inquiries please refer to the next comic panel
Post number #788540, ID: a6149e
|
Python usually prefers readability over everything so if there's a more simple and readable way to do the same thing that's probably the more pythonic one, something being pythonic basically means it follows the style guidelines
Post number #788541, ID: a6149e
|
Tldr read the zen of python and you're basically there
Total number of posts: 7,
last modified on:
Wed Jan 1 00:00:00 1631893242
| Let's start with a question:
What does "it's more pythonic" mean when learning the language?
I've seen and heard it a few times when learning about things like type suggestions, list comprehensions and class definitions. When compared with other structures in python, it boils down to "both are valid, but this one is more pythonic, and this one is more common in other languages, so you can use it for clarity".