Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty zip objects error on __len__ #834

Closed
kg583 opened this issue Mar 10, 2024 · 2 comments
Closed

Empty zip objects error on __len__ #834

kg583 opened this issue Mar 10, 2024 · 2 comments

Comments

@kg583
Copy link

kg583 commented Mar 10, 2024

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
Copy link

I have faced a similar issue as well

@evhub evhub added this to the v3.1.1 milestone Mar 11, 2024
evhub added a commit that referenced this issue Mar 11, 2024
@evhub
Copy link
Owner

evhub commented Mar 11, 2024

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.

@evhub evhub closed this as completed Mar 11, 2024
@evhub evhub mentioned this issue Jun 8, 2024
evhub added a commit that referenced this issue Jun 9, 2024
See Coconut's
[documentation](http://coconut.readthedocs.io/en/develop/DOCS.html) for
more information on all of the features listed below.

Language features:
* #833: New `case def` syntax for more easily defining pattern-matching
functions with many patterns.
* #811: New `f(name=)` syntax as a shorthand for `f(name=name)`,
replacing the now deprecated `f(...=name)` syntax.
* #836: New `CoconutWarning` built-in used for Coconut runtime warnings.

Compiler features:
* #837: Coconut will now warn about implicit string concatenation and
disable it completely with `--strict`.
* #718: Coconut will now warn about use of `addpattern def` without a
prior `match def`. This was a previously-supported feature to make
pattern-matching functions with many patterns easier to write, but the
new recommended way to do that is now via `case def`.
* #785: Initial [pyright](https://github.com/microsoft/pyright) support
via the `--pyright` flag.

Bugfixes:
* #839, #840: Fixed some f-string parsing issues.
* #834: Fixed `len` of empty `zip` objects.
* #830: Improved use of colored output.
* #757: Improved PEP 695 support on Python 3.12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants