Message360189
Most of examples do not test whether findall() returns an empty list. So there is no significant difference with using search() -- just different type of exception if fails (IndexError, TypeError or AttributeError). Since most examples do not handle errors, this will only affect a traceback if you use the script improperly.
If it is important to you, you can write (re.search(...) or [])[0] and get the same IndexError. |
|
Date |
User |
Action |
Args |
2020-01-17 13:52:55 | serhiy.storchaka | set | recipients:
+ serhiy.storchaka, rhettinger, terry.reedy, ezio.melotti, mrabarnett, apalala |
2020-01-17 13:52:55 | serhiy.storchaka | set | messageid: <1579269175.82.0.632596010838.issue39165@roundup.psfhosted.org> |
2020-01-17 13:52:55 | serhiy.storchaka | link | issue39165 messages |
2020-01-17 13:52:55 | serhiy.storchaka | create | |
|