BookOps-CAT / bookops-worldcat

BookOps WorldCat Metadata API wrapper
https://bookops-cat.github.io/bookops-worldcat/
MIT License
35 stars 7 forks source link

WorldcatAccessToken default timeout's mixed info #94

Closed klinga closed 5 months ago

klinga commented 6 months ago

https://github.com/BookOps-CAT/bookops-worldcat/blob/6a865bb91dbbcd6a4bea5773df113fd479cccf33/bookops_worldcat/authorize.py#L42C1-L43C70

I'm concerned about somewhat mixed/confusing timeout defaults in the WorldcatAccessToken class. In the docstring it is stated timeout arg defaults to 3 while its type annotation uses Optional and gives the default value as None. This is somewhat exacerbated in the documentation by the display in the table with default value given as None. I think similar approach as in _session module is clearer:

    ...
        timeout: Union[int, float, Tuple[int, int], Tuple[float, float], None] = (
            5,
            5,
        )