Live data from Hacker News

Ask HN: What's your favorite Python quirk?

news.ycombinator.com

1–5 of 5 posts

Re: Ask HN: What's your favorite Python quirk?

#2
There's a nice list here:

https://github.com/cosmologicon/pywat

Here's another one. Compare "x = 256; y = 256; x is y" with "x = 257" (enter) "y = 257" (enter) "x is y" with "x = 257; y = 257; x is y". It makes a difference whether x and y are assigned on the same line or not. From here:

http://glasnt.com/blog/2016/05/28/on-language-oddities.html

Re: Ask HN: What's your favorite Python quirk?

#3
post #2

There's a nice list here: https://github.com/cosmologicon/pywat Here's another one. Compare "x = 256; y = 256; x is y" with "x = 257" (enter) "y = 257" (enter) "x is y" with "x = 257; y = 257; x is y". It makes a difference whether x and y are assigned on the same line or not. From here: http://glasnt.com/blog/2016/05/28/on-language-oddities.html

Thanks for sharing!