Telegram Group & Telegram Channel
Добавляем классу большую функциональность

Декоратор @ classmethod — это метод, который получает класс в качестве параметра, который принято обозначать как cls. Он указывает на класс ToyClass, а не на объект этого класса.

Методы класса привязаны к самому классу, а не его экземпляру. Они могут менять состояние класса, что отразится на всех объектах этого класса, но не могут менять конкретный объект.

Проще говоря, @ classmethod — это обычный метод класса, имеющий доступ ко всем атрибутам класса, через который он был вызван.

Подписывайтесь на канал 👉@pythonofff



tg-me.com/pythonofff/2989
Create:
Last Update:

Добавляем классу большую функциональность

Декоратор @ classmethod — это метод, который получает класс в качестве параметра, который принято обозначать как cls. Он указывает на класс ToyClass, а не на объект этого класса.

Методы класса привязаны к самому классу, а не его экземпляру. Они могут менять состояние класса, что отразится на всех объектах этого класса, но не могут менять конкретный объект.

Проще говоря, @ classmethod — это обычный метод класса, имеющий доступ ко всем атрибутам класса, через который он был вызван.

Подписывайтесь на канал 👉@pythonofff

BY Python академия




Share with your friend now:
tg-me.com/pythonofff/2989

View MORE
Open in Telegram


telegram Telegram | DID YOU KNOW?

Date: |

The global forecast for the Asian markets is murky following recent volatility, with crude oil prices providing support in what has been an otherwise tough month. The European markets were down and the U.S. bourses were mixed and flat and the Asian markets figure to split the difference.The TSE finished modestly lower on Friday following losses from the financial shares and property stocks.For the day, the index sank 15.09 points or 0.49 percent to finish at 3,061.35 after trading between 3,057.84 and 3,089.78. Volume was 1.39 billion shares worth 1.30 billion Singapore dollars. There were 285 decliners and 184 gainers.

Newly uncovered hack campaign in Telegram

The campaign, which security firm Check Point has named Rampant Kitten, comprises two main components, one for Windows and the other for Android. Rampant Kitten’s objective is to steal Telegram messages, passwords, and two-factor authentication codes sent by SMS and then also take screenshots and record sounds within earshot of an infected phone, the researchers said in a post published on Friday.

telegram from ye


Telegram Python академия
FROM USA