Skip to content

Modernise and type-hint str2bool#8

Open
pace-gene wants to merge 5 commits intosymonsoft:masterfrom
pace-gene:master
Open

Modernise and type-hint str2bool#8
pace-gene wants to merge 5 commits intosymonsoft:masterfrom
pace-gene:master

Conversation

@pace-gene
Copy link

This modernises str2bool, adds tests and type hints. Also migrates from setup.* to UV.

pyproject.toml Outdated
Copy link
Owner

Choose a reason for hiding this comment

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

1.2?

Returns:
Optional[bool]: The converted boolean value, or None if the string cannot be converted and raise_exc is False.
"""
if isinstance(value, str):
Copy link
Owner

Choose a reason for hiding this comment

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

ain't we loosing some backward compatibility?

pyproject.toml Outdated
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure about the lower version

@pace-gene
Copy link
Author

@symonsoft thanks a lot for the review.

I've had another go at this and finally realised that the type hints break python 2 compatibility! As a result I've updated the pyproject and code to reflect this. Python 3.7 is the oldest version I was able to run the test suite with so used this as base version.

Let me know if there's anything else that needs improvement.

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.

2 participants

Comments