This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Matthew Drago
Recipients Matthew Drago, ezio.melotti, mrabarnett
Date 2019-03-01.17:21:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1551460917.2.0.142475833674.issue36158@roundup.psfhosted.org>
In-reply-to
Content
Say for example i want to apply a regex on a list of strings. 

Using list comprehension as such results in the group method not being found.
```
name_regex = compile(r'\[\"([a-zA-Z\s]*)\"{1}')

named_entities = [name_regex.match(entity.trigger).group(1) for entity in entities[0]]
```
This unexpected behavior can also be observed when implementing this using a map.

```
list(map(lambda x: name_regex.search(x.trigger).group(), entities[0])) 
```

However using the traditional for loop implementation the group method is resolved.
```
named_entities = []
for entity in entities[0]:
   named_entities.append(name_regex.match(entity.trigger).group(1))
```
History
Date User Action Args
2019-03-01 17:21:57Matthew Dragosetrecipients: + Matthew Drago, ezio.melotti, mrabarnett
2019-03-01 17:21:57Matthew Dragosetmessageid: <1551460917.2.0.142475833674.issue36158@roundup.psfhosted.org>
2019-03-01 17:21:57Matthew Dragolinkissue36158 messages
2019-03-01 17:21:57Matthew Dragocreate