Telegram Group & Telegram Channel
Что выведет данный код при запуске на Python 3.10+ (например, 3.11)?

📌 Подсказка: Обратите внимание на порядок проверок, на то, какие атрибуты попадают в others, и на использование __match_args__.

Ответ:

Automatic mode
Mode manual, другие ключи: ['threshold', 'debug']
Низкий порог 0
Краткое пояснение:

Для первого объекта (mode="auto", threshold=10) срабатывает первый case Config(mode="auto") → Automatic mode.

Для второго (mode="manual", threshold=5, debug=True) первый не совпадает, второй с threshold.

@Python_Community_ru



tg-me.com/Python_Community_ru/2585
Create:
Last Update:

Что выведет данный код при запуске на Python 3.10+ (например, 3.11)?

📌 Подсказка: Обратите внимание на порядок проверок, на то, какие атрибуты попадают в others, и на использование __match_args__.

Ответ:

Automatic mode
Mode manual, другие ключи: ['threshold', 'debug']
Низкий порог 0
Краткое пояснение:

Для первого объекта (mode="auto", threshold=10) срабатывает первый case Config(mode="auto") → Automatic mode.

Для второго (mode="manual", threshold=5, debug=True) первый не совпадает, второй с threshold.

@Python_Community_ru

BY Python Community




Share with your friend now:
tg-me.com/Python_Community_ru/2585

View MORE
Open in Telegram


Python Community Telegram | DID YOU KNOW?

Date: |

NEWS: Telegram supports Facetime video calls NOW!

Secure video calling is in high demand. As an alternative to Zoom, many people are using end-to-end encrypted apps such as WhatsApp, FaceTime or Signal to speak to friends and family face-to-face since coronavirus lockdowns started to take place across the world. There’s another option—secure communications app Telegram just added video calling to its feature set, available on both iOS and Android. The new feature is also super secure—like Signal and WhatsApp and unlike Zoom (yet), video calls will be end-to-end encrypted.

What is Secret Chats of Telegram

Secret Chats are one of the service’s additional security features; it allows messages to be sent with client-to-client encryption. This setup means that, unlike regular messages, these secret messages can only be accessed from the device’s that initiated and accepted the chat. Additionally, Telegram notes that secret chats leave no trace on the company’s services and offer a self-destruct timer.

Python Community from sg


Telegram Python Community
FROM USA