Commit 20d9cddc authored by Stefan Behnel's avatar Stefan Behnel

support 'frozenset' in cython namespace (just like 'set')

parent fdf00273
No related merge requests found
......@@ -1261,8 +1261,8 @@ class TransformBuiltinMethods(EnvTransform):
node = BoolNode(node.pos, value=True)
elif attribute == u'NULL':
node = NullNode(node.pos)
elif attribute == u'set':
node = NameNode(node.pos, name=EncodedString('set'))
elif attribute in (u'set', u'frozenset'):
node = NameNode(node.pos, name=EncodedString(attribute))
elif not PyrexTypes.parse_basic_type(attribute):
error(node.pos, u"'%s' not a valid cython attribute or is being used incorrectly" % attribute)
return node
......
......@@ -162,14 +162,14 @@ except NameError: # Py3
try:
# Python 3
from builtins import set
from builtins import set, frozenset
except ImportError:
try:
# Python 2.4+
from __builtin__ import set
from __builtin__ import set, frozenset
except ImportError:
# Py 2.3
from sets import Set as set
from sets import Set as set, ImmutableSet as frozenset
# Predefined types
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment