What is Nostr?
David Brownman /
npub1tz2…dsgu
2023-08-03 15:41:30
in reply to nevent1q…7npq

David Brownman on Nostr: npub1e7vnd…5flg9 your escape hatches here are: 1. Hiding incompatible imports under ...

npub1e7vndtpf0s9pcg6yxkmvwvfq2g56rg5694nlgthwg7j2hkjgeuwq65flg9 (npub1e7v…flg9) your escape hatches here are:

1. Hiding incompatible imports under a typing.TYPE_CHECKING conditional (which is always false at runtime)
2. Put uses of those imports in a string annotation, e.g. `a: 'MyType'`

It's no difference to the type checker but has no runtime implication.

I just did this here: https://github.com/xavdid/reddit-user-to-sqlite/blob/main/reddit_user_to_sqlite/reddit_api.py

Check out use of `NotRequired` (only available in 3.10+)
Author Public Key
npub1tz203tkl700kq56fhrhpq5y6aynvejzydppve370fcnqsa6yu4gstwdsgu