I Didn't Know THIS Was Possible With Classes In Python

preview_player
Показать описание
I didn't know this was possible with classes in Python. #code #python #programming
Рекомендации по теме
Комментарии
Автор

You’re really breaking bad with this one

AWriterWandering
Автор

Please don't call functions meth 😅

CallumPooleProgrammer
Автор

J-Jessie, don't call your functions Meth Jessie

samhobson
Автор

So, basically if you call the object as if it was a method, you will execute whatever is defined within the __call__() ?

simaobonvalot
Автор

Talking about the __call__ method ❌
Talking about the naming convention of the methods ✔️

samukaze
Автор

Bro thinking he slick with those *meth* odd names

colourfulyoker
Автор

whats ? the car has meth in it wow. must be a cartel car :)

tomjones
Автор

In other languages this is often known as "invokable" objects. Rarely have I seen sensible use cases for it in the wild. It's almost always clearer to use a descriptive, named method.

ShortFilmVD
Автор

This is why you shouldn’t shorten everything…

earthman
Автор

Class has to be named drug with that function name

slothner
Автор

I really hope python starts msking sense to me now that im getting farther into it. The early stages made perfect sense. Now i just feel lost and stupid.

IanThoen
Автор

Someone: What are you doing in your car?
Me: Meth

pavelgregr
Автор

This feature is really handy for mimicking partial application of functional programming

Nekroido
Автор

For the people who do not know when or in which cases to use it, there is actually lot of cases. If you produce big programs in python you will need to use it, and even more if you create GUI like tkinter. Imagine using tkinter and creating several buttons command. for each button you need a different callback function. You can create a class button callable, and instantiate the class for different buttons and use it as callback for each button

jaylooppworld
Автор

There are similar methods for basically every operator, functionality like iterators, context handlers, and even for accessing class properties.

JonDoe-oybt
Автор

dunder methods are one of the things I really like about python. much easier to make them work than 🦀 std::ops traits

ShadowKestrel
Автор

Ferraris, meth, and callable classes. Yep, this seems like a recipe for disaster.

chucktangy
Автор

We got meth in python code before gta6

sumedh-girish
Автор

I literally heard him like "there is a class called c*m" for a sec 💀

anupam_halder
Автор

You should say: Car called class 😂😂😂😂😂

AliMughrabi
join shbcf.ru