Skip to content

Conversation

@pace-gene
Copy link

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

pyproject.toml Outdated

[project.urls]
Homepage = "https://github.com/symonsoft/str2bool"
Download = "https://github.com/symonsoft/str2bool/tarball/1.1"
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
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
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