All Python Devs Should Know THIS! #code #programming #python

preview_player
Показать описание
All Python devs should know this. #code #programming #python
Рекомендации по теме
Комментарии
Автор

I am the type of programmer that calls functions using only keyword arguments, even if the arguments are positional. That combined with intellisense makes code easier to write and easier to read. It makes the function calls longer, but that’s when you put them on multiple lines to further improve readability.

JordanMetroidManiac
Автор

I like to use the asterisk where the extra arguments are in some arbitrary order, so I don’t want accidental spillage of positional arguments into kwargs.

Evolutionmine
Автор

Wow I knew it was a thing, but had no idea this was how it's done !
Great video

sumukhas
Автор

black magic like this is why I like my static types

GameCyborgCh
Автор

I learned something new in python. Thanks

berlyoge
Автор

I don’t think it makes too much sense to use a forced positional argument unless you are using *args. Explicit is always better than implicit, and the / is ugly in the function signature.

richcaputo
Автор

python devs coming up with the most confusing bullshit just to avoid having static types

nerdycatgamer
Автор

Clear now, I have been looking for this kind of explanation for long time.

estelisarva
Автор

Damn I still have a long way to go. Just started learning python a year ago. Very cool stuff though. I love it!!

gizzywizzy
Автор

I didn't recall the /. I think forcing KWargs is a good thing in some cases tho, particularly during development, so I both like and have used the *

ObiwanNekody
Автор

What is a keyword or positional argument ?
I only know int, char, float, bool and custom data types.

petevenuti
Автор

I think that the child function shouldn't be allowed to dictate how the caller should call it, and this is a bad practice that'll lead to less readable and harder to maintain code.

apollowellstein
Автор

IMHO, the syntax is far from being intuitive. I would rather avoid it to not cause confusions.

romaklimenko
Автор

Whre do you find all this information?

kzwize
Автор

As a JS/TS dev, this seems very powerful and very confusing — but then does everything else in python.

Noam-Bahar
Автор

“What in tarnation…” That is American hick talk there

cetilly
Автор

We keep adding “clever” stuff to python… making it more and more complex. I am starting my journey with Golang since its the opposite of this. I want both options.

facundogoiriz
Автор

I only knew about the asterisk but you didn't mention it's because it becomes an 'every other positional argument' variable

AkivaB
Автор

wait, does / "force all arguments before it to be passed in positional argument"?
does that mean python functions by default support keyword argument?

しめい-lm
Автор

Why not just make a list of those funky parameters?

fusebox
join shbcf.ru