Telegram Group & Telegram Channel
Получаем атрибуты объекта

Функция vars() возвращает все атрибуты переданного параметра, в качестве которого может быть почти что угодно: модуль, класс, экземпляр и т. д.

Проще говоря, vars() возвращает словарь, который хранится в атрибуте __dict__ у переданного объекта.

А если ничего не передать в аргументы, то функция вернет словарь локальных переменных, как и locals() (про это был пост, кстати).

#переменные



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

Получаем атрибуты объекта

Функция vars() возвращает все атрибуты переданного параметра, в качестве которого может быть почти что угодно: модуль, класс, экземпляр и т. д.

Проще говоря, vars() возвращает словарь, который хранится в атрибуте __dict__ у переданного объекта.

А если ничего не передать в аргументы, то функция вернет словарь локальных переменных, как и locals() (про это был пост, кстати).

#переменные

BY Python Academy




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

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.

Launched in 2013, Telegram allows users to broadcast messages to a following via “channels”, or create public and private groups that are simple for others to access. Users can also send and receive large data files, including text and zip files, directly via the app.The platform said it has more than 500m active users, and topped 1bn downloads in August, according to data from SensorTower.Python Academy from us


Telegram Python Academy
FROM USA