THIS Forbidden Python Syntax Will Get You Fired

  Рет қаралды 215,867

Indently

Indently

10 ай бұрын

This forbidden Python syntax will get you fired. #code #programming #python

Пікірлер: 277
@samuelepesce
@samuelepesce 10 ай бұрын
The shame operator
@Indently
@Indently 10 ай бұрын
I love it
@nandyalanaresh1161
@nandyalanaresh1161 10 ай бұрын
​@@Indentlymiric operators
@florunio
@florunio 10 ай бұрын
Great name 😂
@nandyalanaresh1161
@nandyalanaresh1161 10 ай бұрын
@@florunio which one bro shame operator or miric operators
@maciejzettt
@maciejzettt 10 ай бұрын
Yeah, there is already list comprehension, let there be list shaming 😂
@dk-ww3kp
@dk-ww3kp 10 ай бұрын
It should be called illegal.😂
@StudioHawaii
@StudioHawaii 10 ай бұрын
Now I can say "Use an illegal for this"
@samueljehanno
@samueljehanno 9 ай бұрын
😂
@dfields9511
@dfields9511 9 ай бұрын
Yep The ugly thing code I had to write was in c++ *(static_cast(objPtr))->data = Variable ObjPtr was a class was defined like this Class my class : public baseclass , public: datastruct { } And datastruct was defined like this Struct datastruct { Type fields }
@crysian8703
@crysian8703 10 ай бұрын
The comma is because you have to build a tuple to assign each element on the right. The idea is to unpack the elements in _ somewhere. It's like writing a single-element tuple, it needs a comma. A good example of this is ((1, )) == (1, ) or using the match-case
@powerball200
@powerball200 9 ай бұрын
what is this assignment called? and what was this a,*b,c assignemnet called?
@kipchickensout
@kipchickensout 9 ай бұрын
​@@powerball200I think extended unpacking
@G2Rich_
@G2Rich_ 9 ай бұрын
I see so the resulting tuples are mutable which is why the output is Each letter in brackets correct?
@xxlarrytfvwxx9531
@xxlarrytfvwxx9531 9 ай бұрын
​@@G2Rich_The square brackets inform us that it's a _list_.
@krishnakoushiktelanakula9923
@krishnakoushiktelanakula9923 9 ай бұрын
​@@powerball200It's just called tuple assignment.
@RainingArtillery
@RainingArtillery 9 ай бұрын
My favorite part about python is when Isildur fails to cast it into the fire
@knghtbrd
@knghtbrd 2 ай бұрын
That's not how the force works, Gandalf.
@paierarwe
@paierarwe 10 ай бұрын
it should be called Obelisk, as it goes alongside Asterisk
@jabthejewboy
@jabthejewboy 10 ай бұрын
That is so incredibly cursed.
@TheTriggor
@TheTriggor 10 ай бұрын
Reading from _ feels extremely cursed
@MattPlncht
@MattPlncht 9 ай бұрын
You can have anything instead of _ I don't know why he used the underscore instead of a proper variable name
@HoloTheDrunk
@HoloTheDrunk 9 ай бұрын
@@altimmons I've always interpreted it and seen it interpreted as the "ignored" name for a variable (that meaning's actually the official one in Rust as all variables starting with _ are excluded from unused checks done by the compiler)
@no-name168
@no-name168 8 ай бұрын
I've seen pros used underscore for looping when you don't need an actual name, just loop. That's clean af.
@modernkennnern
@modernkennnern 8 ай бұрын
_ should only be used for discards - for when the value is never used.
@christianhowell3140
@christianhowell3140 10 ай бұрын
Id call it the "explosion assignment operator"
@mwaringmlw
@mwaringmlw 10 ай бұрын
It would get you fired because you're using an underscore as a variable name, not for using unpacking. Making something look mysterious and inscrutable is cool for puzzles, I just hope it's not your main method of teaching...
@TheNzdavis
@TheNzdavis 10 ай бұрын
I am new to python and I was really confused why its forbidden until your comment. Thanks.
@user-xo3lh4lo1s
@user-xo3lh4lo1s 2 ай бұрын
Yeah..
@georgileikin
@georgileikin 2 ай бұрын
So no asking "What are you doing?", no advising "Don't do that, it makes the code hard to understand". Straight away FIRED?
@ljreinworth
@ljreinworth 9 ай бұрын
The hesitation operator
@JBroMCMXCI
@JBroMCMXCI 8 ай бұрын
It’s just defining a tuple bruh it’s not a special operator 💀
@beng6319
@beng6319 7 ай бұрын
Guido, you've got some explaining to do!
@CrazyFlyKite
@CrazyFlyKite 8 ай бұрын
The Fire Operator
@bioblade87
@bioblade87 8 ай бұрын
It doesn't have to be an under scroll, it can be any variable assignment eg *charArray, = 'python' It's a neat syntax to know.
@londospark7813
@londospark7813 10 ай бұрын
I would call it the P45 because in the UK that's what you would get if you use it
@vxsniffer
@vxsniffer 9 ай бұрын
more precisely, asterisk operator can be used only for elements in list or tuple, adding comma makes it single-element tuple
@Ctrl_Alt_Elite
@Ctrl_Alt_Elite 10 ай бұрын
Should be called the "melting wink" operator because it looks the right eye fell off while winking
@SchwopSchip-jh2hl
@SchwopSchip-jh2hl 5 ай бұрын
Its called the pistol operator, because it looks like an upside down pistol
@Indently
@Indently 5 ай бұрын
This video came before that one, but I’m happy you made it to the origin ahah
@kgtechs
@kgtechs 10 ай бұрын
its a sequence unpacking. We can use any character instead of ‘_’ it will considered as variable. e.g., *ab,=‘python’ and when you print ab it should give the same output. and comma indicates the tuple. when it will be processed we get the output in list.
@steamer2k319
@steamer2k319 10 ай бұрын
The other commenters seem to agree with you. I'd call it "greedy" "destructuring assignment", though. I guess my JavaScriptyness is showing.
@rahul-thakare
@rahul-thakare 10 ай бұрын
Wink operator 😅
@JordanMetroidManiac
@JordanMetroidManiac 10 ай бұрын
Spiritual successor of the walrus operator.
@josefkaras7519
@josefkaras7519 10 ай бұрын
unpacking/star unpacking
@ziokam1
@ziokam1 10 ай бұрын
I now feel more confused than before i saw this clip!
@Exvixcity
@Exvixcity 10 ай бұрын
String Unpacking
@crashmatrix
@crashmatrix 10 ай бұрын
I mean, it's just pattern matching with wildcard support thrown in, from a certain perspective.
@vodracseck
@vodracseck 10 ай бұрын
list("Python")
@HypnosisBear
@HypnosisBear 5 ай бұрын
Yeah that's more readable and understandable! 👍
@venkyman4985
@venkyman4985 10 ай бұрын
looks like the characters people put in comics when people are fighting
@MalikTheGeek07
@MalikTheGeek07 Ай бұрын
If i needed every single character in a string, id use a for loop 😭
@Sinke_100
@Sinke_100 10 ай бұрын
Same as [*_] just unpacking
@Indently
@Indently 10 ай бұрын
The difference with this one is that it’s much more readable than “*_,”
@Sinke_100
@Sinke_100 10 ай бұрын
@@Indently either way, this kinda content I really apriciate 🙂
@Indently
@Indently 10 ай бұрын
Happy to hear! I don't ever know who appreciates the crazy random syntax you can use with Python ahah
@lifeisfakenews
@lifeisfakenews 10 ай бұрын
the Abomination Operator
@drrichardhertz
@drrichardhertz 8 ай бұрын
Deconstructed assignment
@zekenebel
@zekenebel 9 ай бұрын
The jobseeker
@jonathanlloyd8688
@jonathanlloyd8688 10 ай бұрын
This is cool like javascript unpacking. But i much rather simply cast the string to a list irl. 😂
@vikingthedude
@vikingthedude 10 ай бұрын
It’s the one eyed kirby operator
@jackytaly
@jackytaly 10 ай бұрын
_ is not required, you could put any variable name in there: *a, = ‘Python’
@robinmaurer2645
@robinmaurer2645 9 ай бұрын
_ is used for stuff you get from a return but dont need.
@gameplay-gameplay
@gameplay-gameplay 10 ай бұрын
The splitter
@Terra_135
@Terra_135 10 ай бұрын
I like to call that the unpacking operator bc it essentially just unpacks sequences into multiple values
@nathansavage8692
@nathansavage8692 10 ай бұрын
You use it?!
@Terra_135
@Terra_135 10 ай бұрын
@@nathansavage8692 sometimes, not like shown in the video but say if I have a tuple with arguments I want to pass to a function that has a *args, (or to make a *args function myself)
@kumar_prabhat
@kumar_prabhat 10 ай бұрын
IT'S A WINKYYYYY
@shikanokonokokoshitantan
@shikanokonokokoshitantan 4 ай бұрын
The `saw operator` it looks like a cutting saw and I just saw it.
@tycho1129
@tycho1129 10 ай бұрын
I finally understood. Thx 🙏
@SCPokSecondaccound
@SCPokSecondaccound 10 ай бұрын
I would call this the "help im having a stroke" operator
@malmiteria
@malmiteria 10 ай бұрын
... the unpacking operator?
@satyamARAS
@satyamARAS 9 ай бұрын
Similar ,depends people avoid this now adays I guess.
@TheRythimMan
@TheRythimMan 8 ай бұрын
First thing i thought was "python has pointers?"
@fredericodargel9919
@fredericodargel9919 10 ай бұрын
There's a snake joke there somewhere, I can't just find it.
@samore11
@samore11 10 ай бұрын
Multiple assignment is crazy. How do they come up with this stuff?
@ShortFilmVD
@ShortFilmVD 10 ай бұрын
Some lazy computer scientists who thought they were being clever 😂
@AWriterWandering
@AWriterWandering 10 ай бұрын
The pink slip operator.
@DrDeuteron
@DrDeuteron 10 ай бұрын
Took mine, but I don’t think zoomers know what pink slip is
@nothiiiiiiiing
@nothiiiiiiiing 10 ай бұрын
unpacking operator, use it twice for dictionaries, its actually really useful when used correctly
@DoubleBob
@DoubleBob 10 ай бұрын
When I use it once, I get a list of keys and using it on that list returns the same list. So the second time is redundant. Am I missing something?
@nothiiiiiiiing
@nothiiiiiiiing 10 ай бұрын
@@DoubleBob my_dict = {"a":5,"b":6} def add(a:int,b:int): return a+b print(add(**my_dict)) # prints the result of 5+6
@DoubleBob
@DoubleBob 10 ай бұрын
@@nothiiiiiiiingHuh. I didn't know that kind of feature exists. Not sure how practical this is as this would require the dictionary to have as many items as the function has arguments.
@acoupleofschoes
@acoupleofschoes 3 ай бұрын
​@@DoubleBob * is positional unpacking, so with a dictionary you get the keys. ** is keyword unpacking, you get the values in a dictionary.
@senzmaki4890
@senzmaki4890 10 ай бұрын
The unpack operator is good if you use it the right way, for example if you have a function that returns a tuple of results and another that takes in the individual results you can directly unpack the results in the calls. e.g function2(*function1())
@_sleepy-
@_sleepy- 10 ай бұрын
Wow thank you I didn’t know about unpacking in multi assignment I’ll probably never use it but I love coming across tricks I didn’t know
@Qwerkywoop
@Qwerkywoop 8 ай бұрын
The grabber
@maztaim
@maztaim 10 ай бұрын
The sad pink-eye.
@movax20h
@movax20h 10 ай бұрын
comma is required, because what is on the left is reverse of tuple. so it must be tuple-like. similarly (x) is not a tuple, (x,) is
@Carberra
@Carberra 4 ай бұрын
If *_ is the pistol operator, this should be the deagle operator!
@beerilevinger6886
@beerilevinger6886 9 ай бұрын
It should be called the fuQ operator, for obvious reasons.
@Andreas-gh6is
@Andreas-gh6is 9 ай бұрын
It's a destructuring operator on top of a spread operator...
@abdalmoniem.alhifnawy
@abdalmoniem.alhifnawy 2 күн бұрын
the wink operator *_,
@justindevasia8754
@justindevasia8754 9 ай бұрын
What is the Big '0' notation for this operation??
@xing3240
@xing3240 9 ай бұрын
useful for code golf ig, it is slower though
@ln9296
@ln9296 5 ай бұрын
Its called the gun
@johnmulhall0
@johnmulhall0 6 ай бұрын
The drool operator
@lukanya3124
@lukanya3124 10 ай бұрын
It looks like a snail... Maybe snail unpacking?
@nicholasdavidacruz
@nicholasdavidacruz 9 ай бұрын
Would the interpreter evaluate this weird assignment as the same as: = list() ?
@MyMomCallsMeCyb3rMan
@MyMomCallsMeCyb3rMan 8 ай бұрын
This man, is a villain
@blackandwhitegamingproduct7356
@blackandwhitegamingproduct7356 10 ай бұрын
As a beginner to python, the easiest way to explain this would be that the asterisk is grabbing the string and storing the values to the underscore which then gets printed, correct?
@drewgraham
@drewgraham 10 ай бұрын
ye thats a decent way to explain it.
@no-name168
@no-name168 8 ай бұрын
This actually looks like it has potential but I'd use it only in small readable functions and loops.
@solvital4068
@solvital4068 6 ай бұрын
🔫 Pistol operator!
@emre_ez
@emre_ez 3 күн бұрын
When you write this PEP officials come to your house
@donwald3436
@donwald3436 9 ай бұрын
python syntax that is forbidden: all of it lol.
@jki7449
@jki7449 9 ай бұрын
idk why but im feeling someting like “shmoog” or something idk.
@yeet3833
@yeet3833 10 ай бұрын
that syntax already gave me headache
@ekuwam8989
@ekuwam8989 9 ай бұрын
It’s a split operator
@hicklc01
@hicklc01 8 ай бұрын
I would so use that if I needed to covert a string into a char array. Does it have to be a string literal or can it also be a string variable?
@auaisme
@auaisme 9 ай бұрын
I would call it a parser.
@saaofficial5415
@saaofficial5415 10 ай бұрын
The "starscore" operator
@tm001
@tm001 10 ай бұрын
More like "when you want to get fired"
@bryce-bryce
@bryce-bryce 9 ай бұрын
And why should this be illegal? Its a common use to catch return values that are not of interest avd this is an elegant way to do so
@Fakecloak
@Fakecloak 9 ай бұрын
so what's the use of this syntax in real time?
@Deerbruh
@Deerbruh 10 ай бұрын
The felony operator
@user-ey3uh7sw3g
@user-ey3uh7sw3g 9 ай бұрын
Unpacking operator.
@zohaibanwer5199
@zohaibanwer5199 10 ай бұрын
I would name this.. list pack operator 😅
@kvanctok9234
@kvanctok9234 9 ай бұрын
The list-less list(str) op
@Karandhanwani
@Karandhanwani 10 ай бұрын
Soread operator maybe😅
@octubre_lilaka
@octubre_lilaka 10 ай бұрын
Casts string to char[]
@kiryonnakira7566
@kiryonnakira7566 10 ай бұрын
ocaml: finally a worthy opponent
@sedatmehmed4371
@sedatmehmed4371 10 ай бұрын
I think it was called unpack operator
@antoninolorenzo1215
@antoninolorenzo1215 10 ай бұрын
As someone who don't knows python, even the first feels cursed
@jumo2670
@jumo2670 10 ай бұрын
I thought the b was gonna be a pointer but I think python doesn't even support them
@angryparrot
@angryparrot 9 ай бұрын
Call it violence.
@PeterZaitcev
@PeterZaitcev 2 ай бұрын
looks like one-eyed smile to me
@_a_9773
@_a_9773 10 ай бұрын
Actually the _ is just a variable name same can be done as *x, = string.
@solomonlemma5426
@solomonlemma5426 10 ай бұрын
Why do u call it discusty code??
@dudib94
@dudib94 9 ай бұрын
One eyed unpacking
@alexander191297
@alexander191297 9 ай бұрын
The Swindler’s List… for you’re not a professional Python developer, but a mere swindler to commit such travesty!
@NeUrOmAnCeRAI
@NeUrOmAnCeRAI 9 ай бұрын
It should be called disgusting.
@teazer999999
@teazer999999 9 ай бұрын
It's called "don't write crazy code".
@AshutoshJatkar
@AshutoshJatkar 10 ай бұрын
So much in the name of being pythonic 😂
@potaetoupotautoe7939
@potaetoupotautoe7939 10 ай бұрын
I see what you did there
@BlazeGamingUK4EVER
@BlazeGamingUK4EVER 9 ай бұрын
That syntax is called the sleep bag.
@ren137c
@ren137c 10 ай бұрын
whats the "logic" behind how this works? my default way for the final result would be something like letters = [letter for letter in string], but uh, thats a lot quicker to type lmao. How "efficient" is it?
@ytlongbeach
@ytlongbeach 10 ай бұрын
you're fired
@thatstupiddoll
@thatstupiddoll 10 ай бұрын
It's a tuple literal of one element
@jamesstrand123
@jamesstrand123 10 ай бұрын
it should be called the wannabe c++ syntax typer
@erikblaas5826
@erikblaas5826 9 ай бұрын
I would call this opperator "Trashcan" , because it can consume about everything...
Functions in Python are easy 📞
10:38
Bro Code
Рет қаралды 410 М.
New To Python? Try THIS #python #programming #code
0:56
Indently
Рет қаралды 28 М.
МАМА И STANDOFF 2 😳 !FAKE GUN! #shorts
00:34
INNA SERG
Рет қаралды 4,3 МЛН
Became invisible for one day!  #funny #wednesday #memes
00:25
Watch Me
Рет қаралды 30 МЛН
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 271 М.
The Flaws of Inheritance
10:01
CodeAesthetic
Рет қаралды 905 М.
The Fastest Way to Loop in Python - An Unfortunate Truth
8:06
mCoding
Рет қаралды 1,4 МЛН
How To Use FTP In Python
4:02
Taylor's Software
Рет қаралды 532
5 Cool Python One-Liners
12:23
Indently
Рет қаралды 29 М.
5 Good Python Habits
17:35
Indently
Рет қаралды 406 М.
How to read Haskell code (in 7 minutes)
6:51
peppidesu
Рет қаралды 54 М.
5 Tips To Write Better Python Functions
15:59
Indently
Рет қаралды 95 М.
МАМА И STANDOFF 2 😳 !FAKE GUN! #shorts
00:34
INNA SERG
Рет қаралды 4,3 МЛН