lightly-ai / lightly

A python library for self-supervised learning on images.
https://docs.lightly.ai/self-supervised-learning/
MIT License
2.84k stars 246 forks source link

Update argument types to use Optional whenever possible #1495

Closed otavioon closed 5 months ago

otavioon commented 5 months ago

Python typing hints employ the Optional operator, a shorthand notation for Union[..., None]. While some parts of this project use this shorthand notation, others opt to use Union[..., None]. This PR standardizes the typing hints to use Optional whenever None is the default argument. This enhances the readability of the code in the repository.

guarin commented 5 months ago

Thanks a lot for the PR! The changes look good, will merge once the tests pass :)