Łukasz Langa - Life Is Better Painted Black, or: How to Stop Worrying and Embrace Auto-Formatting

  Рет қаралды 39,854

PyCon 2019

PyCon 2019

Күн бұрын

Пікірлер
@sep69
@sep69 5 жыл бұрын
Came across this video and tried out black. Awesome tool ! Readability of my scribbles improved a lot. Just enabled it in Pycharm.
@JonathanMGithumbi
@JonathanMGithumbi Жыл бұрын
Just now discovering black, can definitely say it changed the way i approach at code formatting
@WebLego
@WebLego 4 жыл бұрын
Love using black, thank you so much for it, great job! The only thing that is weird to me is if one has a short line, and an inline comment on the same line, its like to add brackets around the statement and position the comment in a way that doesnt look related anymore. Maybe fixed by now.
@PanduPoluan
@PanduPoluan 4 жыл бұрын
`black` + judicious (sparing!) use of "# fmt: off" == BLISS Thank you for this great tool, Lukas. I _do_ disagree with a few 'opinions' of Black, but then I took a step back, saw that those were basically bikeshedding, shrugs, and accept. How I wish the current FOSS project I'm now involved in adopted black...
@marco_gorelli
@marco_gorelli 4 жыл бұрын
Great talk, I love using `black` - thanks!
@ewerybody
@ewerybody 4 жыл бұрын
you mean "black"? 😉
@armynyus9123
@armynyus9123 4 жыл бұрын
@@ewerybody Interpreter says: 'black' when I print it
@leaht-pu1tm
@leaht-pu1tm Жыл бұрын
Using it from the terminal to format my files is great. Integration in visual studio code just does not work.
@TotalImmort7l
@TotalImmort7l 3 жыл бұрын
*isort -m 3* and *black -l 79 -t py38* must be the only way.
@liuyangwan1535
@liuyangwan1535 5 жыл бұрын
The github link is 404
@ElenaWilliams-elequ
@ElenaWilliams-elequ 4 жыл бұрын
github.com/psf/black
@liuyangwan1535
@liuyangwan1535 4 жыл бұрын
@@ElenaWilliams-elequ I mean the slides link
@plato4ek
@plato4ek 4 жыл бұрын
Yeah, you're right, looks like they had deleted this repository. There is also no slides of this talk at speakerdeck.com link.
@armynyus9123
@armynyus9123 5 жыл бұрын
So the only thing we miss in python is to agree all on black's default style. Except... that I'll never ever accept double apostrophes - so I patched my black . Ups... :-)
@WebLego
@WebLego 4 жыл бұрын
Just use -s
@armynyus9123
@armynyus9123 4 жыл бұрын
@@WebLego then what's the point of it. We want the same code style project wide and i'm not the only one working on the code base. We'll go with a patched version, there are some options meanwhile, oitnb or axblack. Their ignorance regarding single quotes but leaving line length configurable is a joke.
@MrTigerstyle80
@MrTigerstyle80 4 жыл бұрын
I recently started working on a code base that used black. It is highly annoying. I don’t get why everyone is so head over heels on it.
@মন্দির-ধ৭ণ
@মন্দির-ধ৭ণ 9 ай бұрын
watching in 2024 of learnign python
@StefanoBorini
@StefanoBorini 5 жыл бұрын
20:30 no. that's a pep8 violation and it looks awful. You can't visually distinguish the arguments from the body, and it's absolutely the wrong formatting to do. It becomes even worse when you have a return value type specification.
@Dave__AC
@Dave__AC 5 жыл бұрын
You can visually distinguish the arguments from the body by the dedented ):. The goal of the project is to minimize diffs so the ): has to be on its own line, the decision is just about indentation and their way is the clearest imo. Also it is pep8 compliant to do it this way. "The closing brace/bracket/parenthesis on multiline constructs... may be lined up under the first character of the line that starts the multiline construct" - www.python.org/dev/peps/pep-0008/?#indentation
@StefanoBorini
@StefanoBorini 4 жыл бұрын
@@Dave__AC It is literally defined as wrong in the second verbatim text in that section. Literally. What you are referring to has to do with variables, not function definitions.
@aicryptobro
@aicryptobro 3 жыл бұрын
I checked the first two verbatims in pep8, and neither mentions the sad face on the next line.
@smort123
@smort123 2 жыл бұрын
@@StefanoBorini Its almost as if he told why we write function definitions exactly like we write lists or other data structures.
@maxekstrom6153
@maxekstrom6153 5 жыл бұрын
You lost me at double-quoted strings :)
@DanHaiduc
@DanHaiduc 5 жыл бұрын
I actually prefer double-quotes, because English sometimes uses single quotes. But I am always too lazy to use double-quotes, because of having to hold Shift in addition to pressing the quote button. Black fixes this!
@BennyDaon
@BennyDaon 5 жыл бұрын
You can use ‘-S’ to not change the quotes
@armynyus9123
@armynyus9123 4 жыл бұрын
@@BennyDaon Which is bull.
@hi_arav
@hi_arav 3 жыл бұрын
Just use `black -S|--skip-string-normalization` and keep the rest. :)
@icarus6430
@icarus6430 4 жыл бұрын
you lazy programmers! just spent a little more time and patience! or don't code at all.
@smort123
@smort123 2 жыл бұрын
Jesse what the fuck are you talking about.
@biskitpagla
@biskitpagla 2 жыл бұрын
sure thing grandpa, time for your meds now
Reuven M. Lerner - Practical decorators - PyCon 2019
29:12
PyCon 2019
Рет қаралды 42 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
"What can't WebAssembly do?" - Katie Bell (PyCon AU 2023)
29:03
Carl Meyer - Type-checked Python in the real world - PyCon 2018
32:10
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 210 М.
Dustin Ingram - PEP 572: The Walrus Operator - PyCon 2019
23:18
PyCon 2019
Рет қаралды 17 М.
Elana Hashman - The Black Magic of Python Wheels - PyCon 2019
26:23
The Return of Procedural Programming - Richard Feldman
52:53
ChariotSolutions
Рет қаралды 61 М.
Raymond Hettinger - Super considered super! - PyCon 2015
46:52
PyCon 2015
Рет қаралды 124 М.
Quando A Diferença De Altura É Muito Grande 😲😂
00:12
Mari Maria
Рет қаралды 45 МЛН