Hello I have a function that can return either an empty set {}
or a set of strings: {'string1', 'string2'}
. How would I type hint this?
I can use set[str]
but does it allow an empty set?
Similarly, what would be the type hint for a function that can return either an empty dict or a dict with strings as keys and bool or string as values?
Does dict[str, str|bool]
allow empty dicts?