pyauth / pyotp

Python One-Time Password Library
https://pyauth.github.io/pyotp/
Other
3.03k stars 326 forks source link

use strings as immutable default arguments #162

Closed benjdevries closed 8 months ago

benjdevries commented 8 months ago

Fixes #161

Avoid using mutable objects as default arguments as functions. Even though this particular usage was safe, it opens up the projects to issues down the road if the default argument is mutated within the function. For this usage, we don't need an actual list object, just a sequence of strings, so we can use a string itself.

benjdevries commented 8 months ago

I'm a first time contributor. Please let me know if I should update the PR title or description or if there is any documentation that needs to be updated as well. Thanks!

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 97.19%. Comparing base (e927322) to head (b3e3e5a).

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #162 +/- ## ======================================== Coverage 97.19% 97.19% ======================================== Files 8 8 Lines 214 214 Branches 46 46 ======================================== Hits 208 208 Misses 3 3 Partials 3 3 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

kislyuk commented 8 months ago

Thanks for contributing! I will check the docs/linting and make a new release soon.