amn / csspring

A CSS parsing library
GNU General Public License v3.0
1 stars 0 forks source link

Probably an insufficient type definition for a `cast` in the `selectors` module #2

Closed amn closed 1 month ago

amn commented 2 months ago

Only affects type checking, and MyPy has not complained (invoking it is part of the as of yet unpublished test suite), weirdly perhaps, but on https://github.com/amn/csspring/blob/b930beb96099df4b7aeaafe0c844801d8f8f17bd/src/csspring/selectors.py#L109, the type should rightfully be Product | None not just Product since parsing procedures may legitimately return None (signifying refusal to parse input).

amn commented 1 month ago

Fixed with 2b7b40bbe83f6da2d49619c3c4c27d5b599487ef.