Telegram Group & Telegram Channel
Список импортов по умолчанию

Для ограничения импорта переменных, функций и классов по умолчанию можно использовать список __all__, в который записываются названия объектов, которые будут подключены.

Таким образом, при импорте вида from module import * из модуля c подобной записью подключатся только объекты с названиями из списка __all__.

Тем не менее, в примере выше импортировать функцию foo из такого модуля всё ещё можно, например, с помощью записи from module import foo.

#модули



tg-me.com/python_academy/362
Create:
Last Update:

Список импортов по умолчанию

Для ограничения импорта переменных, функций и классов по умолчанию можно использовать список __all__, в который записываются названия объектов, которые будут подключены.

Таким образом, при импорте вида from module import * из модуля c подобной записью подключатся только объекты с названиями из списка __all__.

Тем не менее, в примере выше импортировать функцию foo из такого модуля всё ещё можно, например, с помощью записи from module import foo.

#модули

BY Python Academy




Share with your friend now:
tg-me.com/python_academy/362

View MORE
Open in Telegram


Python Academy Telegram | DID YOU KNOW?

Date: |

To pay the bills, Mr. Durov is issuing investors $1 billion to $1.5 billion of company debt, with the promise of discounted equity if the company eventually goes public, the people briefed on the plans said. He has also announced plans to start selling ads in public Telegram channels as soon as later this year, as well as offering other premium services for businesses and users.

At a time when the Indian stock market is peaking and has rallied immensely compared to global markets, there are companies that have not performed in the last 10 years. These are definitely a minor portion of the market considering there are hundreds of stocks that have turned multibagger since 2020. What went wrong with these stocks? Reasons vary from corporate governance, sectoral weakness, company specific and so on. But the more important question is, are these stocks worth buying?

Python Academy from us


Telegram Python Academy
FROM USA