PYTHONAA Telegram 4185
🧪 Проверка существования атрибута без try/except

Иногда нужно понять, есть ли у объекта нужное свойство, и не хочется использовать try/except. В этом случае поможет встроенная функция hasattr().

🎯 Итог
Функция hasattr() позволяет лаконично проверить наличие атрибута у объекта — читаемо и без лишних конструкций.



tgoop.com/PythonAA/4185
Create:
Last Update:

🧪 Проверка существования атрибута без try/except

Иногда нужно понять, есть ли у объекта нужное свойство, и не хочется использовать try/except. В этом случае поможет встроенная функция hasattr().

🎯 Итог
Функция hasattr() позволяет лаконично проверить наличие атрибута у объекта — читаемо и без лишних конструкций.

BY Python School




Share with your friend now:
tgoop.com/PythonAA/4185

View MORE
Open in Telegram


Telegram News

Date: |

Telegram is a leading cloud-based instant messages platform. It became popular in recent years for its privacy, speed, voice and video quality, and other unmatched features over its main competitor Whatsapp. Telegram desktop app: In the upper left corner, click the Menu icon (the one with three lines). Select “New Channel” from the drop-down menu. The group’s featured image is of a Pepe frog yelling, often referred to as the “REEEEEEE” meme. Pepe the Frog was created back in 2005 by Matt Furie and has since become an internet symbol for meme culture and “degen” culture. The main design elements of your Telegram channel include a name, bio (brief description), and avatar. Your bio should be: Ng was convicted in April for conspiracy to incite a riot, public nuisance, arson, criminal damage, manufacturing of explosives, administering poison and wounding with intent to do grievous bodily harm between October 2019 and June 2020.
from us


Telegram Python School
FROM American