kerrickstaley / genanki

A Python 3 library for generating Anki decks
MIT License
2.06k stars 161 forks source link

Fix comparison between set and dictionary #146

Closed ernieIzde8ski closed 4 days ago

ernieIzde8ski commented 1 month ago

The check card_ords == {} will always evaluate to False, even when it is empty. This is because card_ords is a set, and {} is a dictionary.

>>> set() == {}
False

The intended check was probably something like "card ords is empty", which can be expressed as if not card_ords.

kerrickstaley commented 4 days ago

Thanks for the PR!