Skip to content

Inconsistent output for two string methods #130910

@pmanas88

Description

@pmanas88

Bug report

Bug description:

# Add a code block here, if required
s = ''
s.islower()
Output: False
s.isascii()
Output: True

Output of these two mthods such as islower() and isascii() are inconsistent.

s.isascii()
Output: True

Explanation for this output is "an empty string passes the isascii() check because it does not contain any non-ASCII characters". This same logic should be applied to islower() method as well or the vice versa.

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions