Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add String.matches to additional string methods #50

Merged
merged 4 commits into from
Dec 8, 2023

Conversation

fdesoye
Copy link

@fdesoye fdesoye commented Jul 2, 2021

Yet another small additional string method.

@fdesoye
Copy link
Author

fdesoye commented Dec 8, 2023

@purcell , any chance to merge and release this reasonably soon?

@@ -36,8 +37,9 @@
'add': lambda self, value: self.append(value)
},
dict: {
'isEmpty': lambda self: self == {},
Copy link
Owner

Choose a reason for hiding this comment

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

I suspect this might be more idiomatic/safer, perhaps, in cases of weird subclassing?

Suggested change
'isEmpty': lambda self: self == {},
'isEmpty': lambda self: bool(self),

Copy link
Author

Choose a reason for hiding this comment

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

Your probably meant not bool(self)? Alternatively we could do len(self) == 0. I do not have a strong opinion here. Pushing the bool solution.

Copy link
Owner

Choose a reason for hiding this comment

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

haha, yep!

@purcell purcell merged commit a4b4fc6 into purcell:master Dec 8, 2023
4 checks passed
@purcell
Copy link
Owner

purcell commented Dec 8, 2023

Thanks, merged and released as 0.6.0

@purcell
Copy link
Owner

purcell commented Dec 8, 2023

Apologies for the long wait

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