Add stubs for bleach #2709
I have updated the stubs now to support Python 2. But I wonder whether we should require contributors to provide Python 2 compatible stubs when they submit new stubs. (Of course existing stubs that support Python 2 should continue to do so.) Making stubs Python 2 compatible requires quite a bit of additional work and it's quite possible that a Python 2 version is not that useful anyway, considering Python 2's end of life date.
Personally I suggest, we accept Python 3-only stubs (and also Python 2-only stubs), even if the library supports both versions. Support for the other Python version can always be added later by an interested party.
Mar 11, 2019
1 check passed
Just installed the new version of mypy and I'm getting some errors on my codebase now from these stubs. Specifically, I'm using bleach's
class Cleaner(object): def __init__( self, tags: List[Text] = ..., attributes: Any = ..., styles: List[Text] = ..., protocols: List[Text] = ..., strip: bool = ..., strip_comments: bool = ..., filters: Optional[List[Type[_Filter]]] = ..., ) -> None: ...
I'm passing tuples for both
Also, I'm passing a list containing a partial object for
@srittau would you be able to fix these issues? I could probably also submit a pull request myself to adjust them, if you'd like (though I've never contributed any stubs before so I'm not very familiar with any of what goes into it).