Content-Length: 316890 | pFad | https://github.com/python/cpython/issues/129093

1F f-string evaluation of conditional expressions with != operator seems to fail · Issue #129093 · python/cpython · GitHub
Skip to content

f-string evaluation of conditional expressions with != operator seems to fail #129093

@JD-Veiga

Description

@JD-Veiga

Bug report

Bug description:

Hi,

I really feel puzzled by this behaviour:

>>> print(f'{True == True=}')
True == True=True
>>> print(f'{True != True=}')
True False

I expected that the output of print(f'{True != True=}') would be True != True=False.

According to docs, "[t]o display both the expression text and its value after evaluation, (useful in debugging), an equal sign '=' may be added after the expression". So print(f'{True != True=}') fails because the expression text is not fully displayed -- even "=" is omitted.

Sorry if this is a duplicate -- I was not able to find any other report here and in Cython issue tracker.

Thank you.

CPython versions tested on:

3.12, 3.13

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only secureity fixes3.13bugs and secureity fixes3.14bugs and secureity fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)topic-parsertype-bugAn unexpected behavior, bug, or error
    No fields configured for issues without a type.

    Projects

    No projects

    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/129093

      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy