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

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

parent fdf00273
...@@ -1261,8 +1261,8 @@ class TransformBuiltinMethods(EnvTransform): ...@@ -1261,8 +1261,8 @@ class TransformBuiltinMethods(EnvTransform):
node = BoolNode(node.pos, value=True) node = BoolNode(node.pos, value=True)
elif attribute == u'NULL': elif attribute == u'NULL':
node = NullNode(node.pos) node = NullNode(node.pos)
elif attribute == u'set': elif attribute in (u'set', u'frozenset'):
node = NameNode(node.pos, name=EncodedString('set')) node = NameNode(node.pos, name=EncodedString(attribute))
elif not PyrexTypes.parse_basic_type(attribute): elif not PyrexTypes.parse_basic_type(attribute):
error(node.pos, u"'%s' not a valid cython attribute or is being used incorrectly" % attribute) error(node.pos, u"'%s' not a valid cython attribute or is being used incorrectly" % attribute)
return node return node
......
...@@ -162,14 +162,14 @@ except NameError: # Py3 ...@@ -162,14 +162,14 @@ except NameError: # Py3
try: try:
# Python 3 # Python 3
from builtins import set from builtins import set, frozenset
except ImportError: except ImportError:
try: try:
# Python 2.4+ # Python 2.4+
from __builtin__ import set from __builtin__ import set, frozenset
except ImportError: except ImportError:
# Py 2.3 # Py 2.3
from sets import Set as set from sets import Set as set, ImmutableSet as frozenset
# Predefined types # 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