Live data from Hacker News

What is Pythonic? (2005)

blog.startifact.com

11–20 of 21 posts

Re: What is Pythonic? (2005)

#11

Functional is the new pythonic! (edit: It actually is, half of the good things in Python, like list comprehensions and tuples and destructuring, were first seen in functional languages!)

BDFL Guido van Rossum is not in favor of adding functional programming stuff to python. So, by fiat, functional programming is not very pythonic. :)

Re: What is Pythonic? (2005)

#12
post #8

I think it's important to think of Pythonic as something that's subjective and evolving. The C examples given are idiomatic in C. The reason they're idiomatic is because they fit with a mental model that most of the C community uses: data structures in an enumerated address space, and passing around hunks of mutable memory with handshake semantics. If your code interacts with code that was written with that in mind,…

You can't have this both ways. Either what is 'Pythonic' is subjective and community-based AND your arguments about Haskell are also subjective and based on the Haskell community, or some things are just better than others both within Python and among languages.

But even in the second case, you have to do more than wave your hands around to show that Haskell is superior if you want to move beyond pure, substance-less snobbery. If you did that, you'd find that you were leaning on some assumed values - for example, the values of the Haskell community.

If all you have to say is that Python's values are subjective while Haskell's values are the actually important ones, this is really pure snobbery without any substance.

Re: What is Pythonic? (2005)

#13
post #11

Functional is the new pythonic! (edit: It actually is, half of the good things in Python, like list comprehensions and tuples and destructuring, were first seen in functional languages!)

BDFL Guido van Rossum is not in favor of adding functional programming stuff to python. So, by fiat, functional programming is not very pythonic. :)

You are both partially right. List comprehensions are considered pythonic, and they are similar to map and filter from the FP world. However the map and filter functions themselves are somewhat unpythonic.

Re: What is Pythonic? (2005)

#14

Functional is the new pythonic! (edit: It actually is, half of the good things in Python, like list comprehensions and tuples and destructuring, were first seen in functional languages!)

Half the good things in any halfway decent language are also seen in any other halfway decent language.

Re: What is Pythonic? (2005)

#15
post #11

Earlier quoted context omitted.

BDFL Guido van Rossum is not in favor of adding functional programming stuff to python. So, by fiat, functional programming is not very pythonic. :)

You are both partially right. List comprehensions are considered pythonic, and they are similar to map and filter from the FP world. However the map and filter functions themselves are somewhat unpythonic.

I guess list comprehensions in Python are, as you say, similar to map and filter from the FP world, but they are even more similar to... list comprehensions from the FP world.

Re: What is Pythonic? (2005)

#16
We might be in the "post-pythonic" Python era. There was a discussion a few months back on #python to the effect that judging "pythonic"-ness was a shibboleth indicating the judger was not the best Python community member. Wish I could find a log.

Re: What is Pythonic? (2005)

#17
post #12
post #8

I think it's important to think of Pythonic as something that's subjective and evolving. The C examples given are idiomatic in C. The reason they're idiomatic is because they fit with a mental model that most of the C community uses: data structures in an enumerated address space, and passing around hunks of mutable memory with handshake semantics. If your code interacts with code that was written with that in mind,…

You can't have this both ways. Either what is 'Pythonic' is subjective and community-based AND your arguments about Haskell are also subjective and based on the Haskell community, or some things are just better than others both within Python and among languages. But even in the second case, you have to do more than wave your hands around to show that Haskell is superior if you want to move beyond pure, substance-less…

I don't think trjordan said anything like that.

Re: What is Pythonic? (2005)

#18
post #11

Earlier quoted context omitted.

BDFL Guido van Rossum is not in favor of adding functional programming stuff to python. So, by fiat, functional programming is not very pythonic. :)

You are both partially right. List comprehensions are considered pythonic, and they are similar to map and filter from the FP world. However the map and filter functions themselves are somewhat unpythonic.

"unpythonic" once again meaning "disliked by van Rossum."

Re: What is Pythonic? (2005)

#19
post #6

Earlier quoted context omitted.

In most of those cases there's no point thinking of them, just type the first one that comes to mind and move on

I hate poorly styled code. Edit: I don't know why I'm being downvoted for this. That kind of mentality inherently churns out bad code.

They're all inconsequential to code quality except for some like i++ vs ++i which isn't even style, it's syntax. preincrement before, postincrement after, not hard to remember

Re: What is Pythonic? (2005)

#20
post #6

Earlier quoted context omitted.

I hate poorly styled code. Edit: I don't know why I'm being downvoted for this. That kind of mentality inherently churns out bad code.

They're all inconsequential to code quality except for some like i++ vs ++i which isn't even style, it's syntax. preincrement before, postincrement after, not hard to remember

Syntax and style are tightly coupled in Python. It's not hard to remember i++ is the same as i+=1 or that if(bool) { can optionally have a line break between the guard and the brace. In other languages, you have more choices. If you have more choices and just type what comes to mind first, you're going to get stylistic inconsistencies.
Post reply on HN