Answer the question
In order to leave comments, you need to log in
Why do I need to additionally import subsections of libraries if the library itself is already imported?
Good day.
Why do you need to additionally import subsections of libraries into Python, if the library itself is already fully imported?
Example:
import telebot
from telebot import что-то там
Answer the question
In order to leave comments, you need to log in
Only if instead telebot.some_method()
of writing simply some_method()
.
In cases where it is necessary to achieve a minimum consumption of RAM, for example, for deploying to cloud functions, or for running on devices with very limited resources, specific classes, functions, and not the entire module are imported.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question