Closed learnbyexample closed 3 years ago
s
is more appropriate as per the guidelines and other snippet conventions, instead of ipstr
.defaults to non-alpha and hyphens as regexp
. (or alphanumeric and hypens
if the regexp is swapped.Overall, the suggestions are all solid. Could you open a PR for this, if you have the time? Remember to tag Fixes #280
in the description.
Could you open a PR for this
https://github.com/30-seconds/30-seconds-of-python/blob/master/CONTRIBUTING.md says npm
is needed, which I'm not willing to install/learn. I do not mind someone else who is familiar with this project to make the changes.
Link: https://www.30secondsofcode.org/python/s/words. Existing snippet:
re.findall
instead ofre.split
andfilter
. This will also change to positive character class instead of negated one.str
is a built-in function and raw-strings are preferred to define regular expression patterns'\\b[a-zA-Z-]+\\b'