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


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

Ответ:

Automatic mode
Mode manual, other keys: ['threshold', 'debug']
Low threshold 0
Краткое пояснение:

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

Для второго (mode="manual", threshold=5, debug=True) первый не совпадает, второй с threshold<5 не проходит (5 < 5 → False), зато третий case Config(mode=mode, **others) — биндинг mode='manual', остальные ключи (threshold и debug) попадают в others → Mode manual, other keys: ['threshold', 'debug'].

Для третьего (threshold=0) первый и третий не подходят (нет mode), а второй — case Config(threshold=threshold) if threshold<5 — срабатывает (0<5) → Low threshold 0.


@pythonl



tg-me.com/pythonl/4785
Create:
Last Update:

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


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

Ответ:

Automatic mode
Mode manual, other keys: ['threshold', 'debug']
Low threshold 0
Краткое пояснение:

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

Для второго (mode="manual", threshold=5, debug=True) первый не совпадает, второй с threshold<5 не проходит (5 < 5 → False), зато третий case Config(mode=mode, **others) — биндинг mode='manual', остальные ключи (threshold и debug) попадают в others → Mode manual, other keys: ['threshold', 'debug'].

Для третьего (threshold=0) первый и третий не подходят (нет mode), а второй — case Config(threshold=threshold) if threshold<5 — срабатывает (0<5) → Low threshold 0.


@pythonl

BY Python/ django




Share with your friend now:
tg-me.com/pythonl/4785

View MORE
Open in Telegram


Python django Telegram | DID YOU KNOW?

Date: |

Telegram auto-delete message, expiring invites, and more

elegram is updating its messaging app with options for auto-deleting messages, expiring invite links, and new unlimited groups, the company shared in a blog post. Much like Signal, Telegram received a burst of new users in the confusion over WhatsApp’s privacy policy and now the company is adopting features that were already part of its competitors’ apps, features which offer more security and privacy. Auto-deleting messages were already possible in Telegram’s encrypted Secret Chats, but this new update for iOS and Android adds the option to make messages disappear in any kind of chat. Auto-delete can be enabled inside of chats, and set to delete either 24 hours or seven days after messages are sent. Auto-delete won’t remove every message though; if a message was sent before the feature was turned on, it’ll stick around. Telegram’s competitors have had similar features: WhatsApp introduced a feature in 2020 and Signal has had disappearing messages since at least 2016.

How to Buy Bitcoin?

Most people buy Bitcoin via exchanges, such as Coinbase. Exchanges allow you to buy, sell and hold cryptocurrency, and setting up an account is similar to opening a brokerage account—you’ll need to verify your identity and provide some kind of funding source, such as a bank account or debit card. Major exchanges include Coinbase, Kraken, and Gemini. You can also buy Bitcoin at a broker like Robinhood. Regardless of where you buy your Bitcoin, you’ll need a digital wallet in which to store it. This might be what’s called a hot wallet or a cold wallet. A hot wallet (also called an online wallet) is stored by an exchange or a provider in the cloud. Providers of online wallets include Exodus, Electrum and Mycelium. A cold wallet (or mobile wallet) is an offline device used to store Bitcoin and is not connected to the Internet. Some mobile wallet options include Trezor and Ledger.

Python django from id


Telegram Python/ django
FROM USA