About changing the implementation. When we started to take
Tuple, some calls to external libs became mypy-invalid because some of them require onlyList. So i converted tuples to lists where possible.
Frankly, compatibility with 3rd party libs shouldn't be the first priority when making changes. If they need a list, convert the input yourself, that's not PTBs job ;)
And do you actually think that a list passed to
__init__()should ever be preserved as-is when assigned to instance attr? It's understandable that property setters preserve them. But__init__()makes a brand-new instance with brand-new attrs. Preserving lists may lead to bad side-effects that would be hard to find.
You have a point here. However, changing
def __init__(self, some_list: List):
self.some_list = some_list
to
def __init__(self, some_list: List):
self.some_list = list(some_list)
everywhere in the code is a largely independent issue. As of now the aim of this PR is just to make type hinting a bit more generous. So please either only change signatures or go the full way and adjust the behaviour of every __init__ in the lib ;)
I'll try to have a closer look at the new changes soon.