Тёмный

recursively import python modules (intermediate) anthony explains  

anthonywritescode
Подписаться 41 тыс.
Просмотров 2,7 тыс.
50% 1

Опубликовано:

 

13 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 7   
@sadhlife
@sadhlife 2 года назад
ok, this plugin architecture is way better than the idea I had before, which was to use globs xD
@dimitarganev7797
@dimitarganev7797 2 года назад
I can give you my use-case and I've actually left a feature just because I didn't know how to execute it. So my use-case was to dynamically import classes that have a common interface and can be used in some ORM-like way such as select(class_name).where(...) and we did that by importing the class and passing it as a reference to the select function. What I did was a function which will resolve it dynamically by passing a string to the select function and then using the __subclasses__() method to get a list with the classes that derive from that particular class that can be used in the select. The thing was that not all modules were loaded during this dynamic importing and the list in the __subclasses__() was incomplete, I added the missing entries manually with __import__ but i didn't like the solution and I left it, now I can get back to it and finish it with that. Great Information as always, I am following this channel since a year and I learned a lot, thank you for your efforts!!
@akshaymestry971
@akshaymestry971 2 года назад
We always find your content to be super informative, educational and useful in a productive way! Today Dec 17, 2021 according to India time, marks my one year anniversary following you on this platform and I wanna confess or say, "YOU ARE THE BEST RU-vidR!" (not just a tutor) in my honest opinion! I always find your content super useful for practical day job and educational at the same time. In my lifetime, if I ever get an opportunity to meet you, I'll cry my eyes out by happiness! My man you're AWESOME!
@anthonywritescode
@anthonywritescode 2 года назад
thanks for sticking around!
@akshaymestry971
@akshaymestry971 2 года назад
@@anthonywritescode will do, always!!
@xaro6132
@xaro6132 2 года назад
Hey Anthony thank you for the videos i watch them all! i just have a question if there is any reason for using __path__ instead of __file__?
@anthonywritescode
@anthonywritescode 2 года назад
yeah I go over that in this video
Далее
Faites comme moi
00:14
Просмотров 1,8 млн
А ВЫ ЛЮБИТЕ ШКОЛУ?? #shorts
00:20
Просмотров 3,7 млн
Please Master These 10 Python Functions…
22:17
Просмотров 154 тыс.
Python Modules and Packages - A Brief Introduction
13:51
What are Python __future__ imports?
8:18
Просмотров 44 тыс.
This Is Why Python Data Classes Are Awesome
22:19
Просмотров 805 тыс.
Faites comme moi
00:14
Просмотров 1,8 млн