Logo

Programming-Idioms

History of Idiom 110 > diff from v32 to v33

Edit summary for version 33 by justafoo:
[Python] fix

Version 32

2019-09-26, 17:50:55

Version 33

2019-09-26, 17:54:34

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Idiom #110 Check if string is blank

Set boolean blank to true if string s is empty, or null, or contains only whitespace ; false otherwise.

Code
blank = s is None or s == '' or s.isspace()
Code
blank = not s or s.isspace()