Skip to content

Fix argument annotation in converter.parse() signature#1665

Merged
mscuthbert merged 1 commit into
masterfrom
fix-mypy-error
Jan 2, 2024
Merged

Fix argument annotation in converter.parse() signature#1665
mscuthbert merged 1 commit into
masterfrom
fix-mypy-error

Conversation

@jacobtylerwalls

Copy link
Copy Markdown
Member

Fixes error reported in #1664 (comment).

Adds missing coverage.

valueStr = ''

if (common.isListLike(value)
and isinstance(value, collections.abc.Sequence)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redundant now that isListLike no longer permits sets

elif (common.isListLike(value)
and isinstance(value, collections.abc.Sequence)
and len(value) == 2
and isinstance(value[1], int)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was preventing the more informative error message below, allowing later elif blocks to match and crash.

@jacobtylerwalls jacobtylerwalls mentioned this pull request Nov 18, 2023
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.051% (+0.009%) from 93.042%
when pulling 515e0e6 on fix-mypy-error
into a938a8c on master.

Comment on lines +2079 to +2080
with self.assertRaises(ConverterException):
parse((fp, 8))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow... bug.

@mscuthbert mscuthbert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Looks great.

@mscuthbert mscuthbert merged commit defd61e into master Jan 2, 2024
@mscuthbert mscuthbert deleted the fix-mypy-error branch January 2, 2024 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants