Better HN
topnewbestaskshowjobs
Log inSign up

pizzaburek

188 karma · joined Oct 4, 2015 (11y ago) · 29 submissions

Submissions

comment 4y ago · link · parent

For my personal Python projects I set a hard limit in the 94-96 range. That's wide enough that I actualy adhere to it instead of just ignoring it.

PEP8's and Google style guide's limits of 79 and 80 are way to narrow for a language with 4 space identation. However PEP says that "it is okay to increase the line length limit up to 99 characters" while Google's 80 is just a soft limit that can be broken in certain cases like long URLs.

2.

Best Python Reference Ever(gto76.github.io ↗)

5 points · by pizzaburek · 6y ago · discuss

3.

Best Python Reference Ever(github.com ↗)

120 points · by pizzaburek · 6y ago · 19 comments

4.

Comprehensive Python Cheatsheet (2018)(github.com ↗)

2 points · by pizzaburek · 7y ago · discuss

5.

Best Python Cheatsheet Ever(gto76.github.io ↗)

3 points · by pizzaburek · 7y ago · discuss

comment 7y ago · link · parent

My personal opinion is that `list_` is among the worst possible variable names (together with `bar` and `foo`). It's non-descriptive, ugly, hard to recognize, looks scary to beginners and maybe worst of all it's easy to forget the underscore when typing.

comment 7y ago · link · parent

Yes, although there is a saying that "every generator is an iterator, but not every iterator is a generator". But then again generator has a bunch of methods (close, gi_frame, gi_yieldfrom, throw, gi_code, gi_running, send) that iterators don't have... I really don't know if <iter> is correct enough here, or should I use <genr> (that I don't use anywhere else and could be confusing).

comment 7y ago · link · parent

   MIND = BLOWN

comment 7y ago · link · parent

Will look into it, thanks for info.

comment 7y ago · link · parent

The whole cheatsheet is clearly in Python 3, where the same doc page that you linked states:

   Performing list(d) on a dictionary returns a list of all the keys used in the dictionary, in 
   insertion order ...

comment 7y ago · link · parent

Because it's rendered directly from README.md. That way it's easier for me, because I don't have to render it every time I make a change (I make a lot of little edits all the time), and project's Github page (https://github.com/gto76/python-cheatsheet) always has the same content as webpage.

comment 7y ago · link · parent

   >>> list(dict.fromkeys([3, 2, 1]))
   [3, 2, 1]
   >>> list(set([3, 2, 1]))
   [1, 2, 3]

13.

Comprehensive Python Cheatsheet (2018)(gto76.github.io ↗)

335 points · by pizzaburek · 7y ago · 81 comments

14.

Make Linux Less Painful with Standard Aliases(github.com ↗)

1 points · by pizzaburek · 11y ago · discuss

15.

200+ Handy Bash Shell Aliases for Linux / Unix / Mac OS X(github.com ↗)

2 points · by pizzaburek · 11y ago · discuss

comment 11y ago · link · parent

Too bad that a far more interesting discussion about Libertarian communism got flagged (or at least is not visible on a main page). https://news.ycombinator.com/item?id=10351830

comment 11y ago · link · parent

It takes too long to compile otherwise, and I didn't want people to give up during compilation... You can run 'make optimize' to use -O1