Skip to content

Test edge case in isdigit() method #151335

@manoj-marimuthu

Description

@manoj-marimuthu

Feature or enhancement

Proposal:

test_isdigit() in Lib/test/string_tests.py, Misses an edge case where a string with only digits and whitespaces are provided. Example - "123 ".isdigit() is False. It could be valid to test this case.

Tests provided already:

self.checkequal(False, '', 'isdigit')
self.checkequal(False, 'a', 'isdigit')
self.checkequal(True, '0', 'isdigit')
self.checkequal(True, '0123456789', 'isdigit')
self.checkequal(False, '0123456789a', 'isdigit')
self.checkraises(TypeError, 'abc', 'isdigit', 42)

Has this already been discussed elsewhere?

No response given

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    testsTests in the Lib/test dirtype-featureA feature request or enhancement
    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