Live data from Hacker News

Best Python Reference Ever

github.com

1–10 of 20 posts

Re: Best Python Reference Ever

#4
A key hallmark of Python is readability - which this cheat sheet has managed to royally screw up.

It looks more like an XML cheatsheet at first glance.

I work in python full-time for a living, and found myself having to re-examine several times to make sense of this wacky, non-standard notation.

-------

Edit:

Keep in mind there's a standard way to represent these options in a clear, consistent manner (lists, sequences, optional args).

No need to re-invent something that's hard to read and understand.

See: https://docs.python.org/3/library/stdtypes.html#sequence-typ...

Re: Best Python Reference Ever

#5
post #4

A key hallmark of Python is readability - which this cheat sheet has managed to royally screw up. It looks more like an XML cheatsheet at first glance. I work in python full-time for a living, and found myself having to re-examine several times to make sense of this wacky, non-standard notation. ------- Edit: Keep in mind there's a standard way to represent these options in a clear, consistent manner (lists, sequence…

I think this is for people who already know Python, and just need a quick memory aid. I agree for a complete and correct reference I would recommend the documentation, as you said.

A proper cheatsheet takes liberties for the sake of achieving both brevity and comprehensiveness at the same time.

Re: Best Python Reference Ever

#6
post #4

A key hallmark of Python is readability - which this cheat sheet has managed to royally screw up. It looks more like an XML cheatsheet at first glance. I work in python full-time for a living, and found myself having to re-examine several times to make sense of this wacky, non-standard notation. ------- Edit: Keep in mind there's a standard way to represent these options in a clear, consistent manner (lists, sequence…

While I agree the notation is a bit weird, I disagree that there is any standard notation for types. The Python docs in particular fail for exactly one of the things I like about TFA - it tells you the type of the output of each function in its angle-bracketed style.

Take, for example, the definition of the operation s[i:j] in the Python docs: the result is "slice of s from i to j". Is that the same type as the input? Is it an iterator? No information.

I doubt most people are confused about the output, but a reference is specifically for people who are uncertain about how a function works.

Re: Best Python Reference Ever

#7
Great resource

>> .append() # Or: += []

Not a fan of the += syntax in this instance - seeing .append instantly lets me know I'm dealing with a list whereas += can be used on almost anything

Re: Best Python Reference Ever

#9
post #4

A key hallmark of Python is readability - which this cheat sheet has managed to royally screw up. It looks more like an XML cheatsheet at first glance. I work in python full-time for a living, and found myself having to re-examine several times to make sense of this wacky, non-standard notation. ------- Edit: Keep in mind there's a standard way to represent these options in a clear, consistent manner (lists, sequence…

the hallmark is readability?! really!?

Please explain to me why then you introduce a binding after you use it in array comprehensions.

    [x*2 for x in range(1,10)]

Re: Best Python Reference Ever

#10
I use Python full time and I found this useful. Starred it for future reference.

Why does everyone find the notation confusing? means its a list, and so on. I'm really surprised it's tripping people up.

Post reply on HN