python: why object() in this code? (intermediate) anthony explains #243

preview_player
Показать описание
today I talk about a little trick utilizing object() and why you might also need the same thing!

==========

I won't ask for subscriptions / likes / comments in videos but it really helps the channel. If you have any suggestions or things you'd like to see please comment below!
Рекомендации по теме
Комментарии
Автор

It would be great to have a video on the use cases of enums in Python!

denispmaciel
Автор

Question could you not have accomplished the same thing by saying
def func(dct):
if 'k' in dct:
print("found k")
else:
print("no key")

tompov
Автор

Could you zoom in on the relevant window when typing? Would make it a lot easier to casually view the videos on a phone screen without having to guess what is written (based on what you say).

Nixxen
Автор

Great video as always! One question though, how good is object vs Any when used for type hinting? Doesn't Any and object "kinda" work in a same way?

akshaymestry