evhub / coconut

Simple, elegant, Pythonic functional programming.
http://coconut-lang.org
Apache License 2.0
4.04k stars 120 forks source link

Empty `zip` objects error on `__len__` #834

Closed kg583 closed 5 months ago

kg583 commented 5 months ago

Getting the length of an empty zip object (e.g. len(zip())) raises

ValueError: min() iterable argument is empty

since the length is computed as the minimum length among the iterators, but no default value is set.

neel11235813 commented 5 months ago

I have faced a similar issue as well

evhub commented 5 months ago

Fixed as of coconut-develop>=3.1.0-post_dev3 (pip uninstall coconut && pip install -U coconut-develop>=3.1.0-post_dev3). Also universalizes default= argument for min and max built-ins.