-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Conversation
# Conflicts: # airspeed/__init__.py
@purcell , any chance to merge and release this reasonably soon? |
airspeed/__init__.py
Outdated
@@ -36,8 +37,9 @@ | |||
'add': lambda self, value: self.append(value) | |||
}, | |||
dict: { | |||
'isEmpty': lambda self: self == {}, |
There was a problem hiding this comment.
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?
'isEmpty': lambda self: self == {}, | |
'isEmpty': lambda self: bool(self), |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
haha, yep!
Thanks, merged and released as 0.6.0 |
Apologies for the long wait |
Yet another small additional string method.