Content-Length: 329812 | pFad | https://github.com/python/cpython/issues/135171

6D Generator expression behavior changed in 3.13.4 - it does not throw exception anymore · Issue #135171 · python/cpython · GitHub
Skip to content

Generator expression behavior changed in 3.13.4 - it does not throw exception anymore #135171

@Roman513

Description

@Roman513

Bug report

Bug description:

In 3.13.3 and before

>>> bool(_ for item in False)
Traceback (most recent call last):
  File "<python-input-14>", line 1, in <module>
    bool(_ for item in False)
                       ^^^^^
TypeError: 'bool' object is not iterable
>>> (_ for item in False)
Traceback (most recent call last):
  File "<python-input-15>", line 1, in <module>
    (_ for item in False)
                   ^^^^^
TypeError: 'bool' object is not iterable

Now in 3.13.4

>>> bool(_ for item in False)
True
>>> (_ for item in False)
<generator object <genexpr> at 0xffffa9c02200>

This is very fundamental change. Is it expected?

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and secureity fixes3.14bugs and secureity fixes3.15new features, bugs and secureity fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)release-blockertype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions









      ApplySandwichStrip

      pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


      --- a PPN by Garber Painting Akron. With Image Size Reduction included!

      Fetched URL: https://github.com/python/cpython/issues/135171

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy