4 ms·
> (Have a look at what dir() returns on a regex pattern object). Python 2.7.13 (default, Dec 20 2016, 16:00:28) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (cla
by atdt 9y ago
> (Have a look at what dir() returns on a regex pattern object).
Python 2.7.13 (default, Dec 20 2016, 16:00:28)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import re; dir(re.compile(''))
['__class__', '__copy__', '__deepcopy__', '__delattr__',
'__doc__', '__format__', '__getattribute__', '__hash__',
'__init__', '__new__', '__reduce__', '__reduce_ex__',
'__repr__', '__setattr__', '__sizeof__', '__str__',
'__subclasshook__', 'findall', 'finditer', 'flags',
'groupindex', 'groups', 'match', 'pattern', 'scanner',
'search', 'split', 'sub', 'subn']
Looks OK to me. What am I missing?
- js2 9y agoThat was apparently fixed in Python 2.7: https://github.com/python/cpython/commit/6116d4a1d1ecd6e9b94cfaa524b9b7cd5a6b5447 https://github.com/python/cpython/commit/6116d4a1d1ecd6e9b94... http://bugs.python.org/issue12099 http://bugs.python.org/issue12099 But that commit pre-dates the blog post by many years, so maybe Armin was referring to something else, or maybe he hadn't realized it had been fixed?