Can you explain it to me like i’m a 10 yrs old (which i’m not 🙄), then?
Can you explain it to me like i’m a 10 yrs old (which i’m not 🙄), then?
Nice! It looks like the best solution out there.
Python >= 3.10 version:
def foo(return_more: bool) -> DataType | tuple[DataType, MoreDataType]: ...
But i would definitely avoid to do that if possible. I would maybe do something like this instead:
def foo(return_more: bool) -> tuple[DataType, MoreDataType | None]:
...
if return_more:
return data, more_data
return data, None
Or if data
is a dict
, just update it with more_data
:
def foo(return_more: bool) -> dict[str, Any]:
...
if return_more:
return data.update(more_data)
return data
From what i understand, Protocol
is for custom interfaces that you define (this object must have do_x()
method), while ABCs are generic (this object is iterable).
Yup, that’s what i would also do.
Ok i think i get the point. A “generic programming language” could be used as a “domain specific language” in some context. Is that what you mean?
You won’t see the end of these crapwares until there is centralized managment console with it, sadly…
You can use KeePassXC (with a dedicated vault or not), synced by another mean (Nextcloud, Syncthing, Git, etc.).