[New-bugs-announce] [issue13599] Compiled regexes don't show all attributes in dir()

Martin Häcker report at bugs.python.org
Wed Dec 14 09:13:45 CET 2011


New submission from Martin Häcker <spamfaenger at gmx.de>:

When looking at a regex with dir() you don't get all available attributes - which is inconvenient as some very important ones (like .pattern) are not visible.

To demonstrate:

> import re
> re.compile('foo').pattern
'foo'
> dir(re.compile('foo'))

['__copy__',
 '__deepcopy__',
 'findall',
 'finditer',
 'match',
 'scanner',
 'search',
 'split',
 'sub',
 'subn']

----------
components: Regular Expressions
messages: 149428
nosy: dwt, ezio.melotti
priority: normal
severity: normal
status: open
title: Compiled regexes don't show all attributes in dir()
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13599>
_______________________________________


More information about the New-bugs-announce mailing list