Add tests to bring Synchronization.py to 100% coverage
Add type annotations to the synchronization primitives
Add typing_extensions as a Python 3.9 requirement; this is needed to annotate that the synchronized() decorator takes a function with a certain set of parameter and return types and returns a function with the same parameter and return types
Changed
Make the synchronized function's self parameter explicit; this allows the self parameter to be type-annotated so the dependency on the self.mutex attribute is explicit
Use the self.mutex lock as a context manager
Support keyword arguments to synchronized functions
Fixed
Wrap synchronized functions correctly; previous behavior was to lose the function name and docstring
Removed
Remove print() lines that are commented out
Remove a bytes instance check; method names can only be strings
coverage: 64.919% (+0.3%) from 64.591%
when pulling d984eecf0e3481c9c80b3d6921ca19d43b9da2f4 on kurtmckee:test-synchronization
into f162aa2f646863fad62599378be67c5b31fd751f on LudovicRousseau:master.
Added
Synchronization.py
to 100% coveragetyping_extensions
as a Python 3.9 requirement; this is needed to annotate that thesynchronized()
decorator takes a function with a certain set of parameter and return types and returns a function with the same parameter and return typesChanged
self
parameter explicit; this allows theself
parameter to be type-annotated so the dependency on theself.mutex
attribute is explicitself.mutex
lock as a context managerFixed
Removed
print()
lines that are commented outbytes
instance check; method names can only be strings