Commit 81161bc8 authored by Stefan Behnel's avatar Stefan Behnel

fix 'cython.set' and 'cython.frozenset' when set/frozenset are declared names in the module

parent c1902976
...@@ -1262,7 +1262,8 @@ class TransformBuiltinMethods(EnvTransform): ...@@ -1262,7 +1262,8 @@ class TransformBuiltinMethods(EnvTransform):
elif attribute == u'NULL': elif attribute == u'NULL':
node = NullNode(node.pos) node = NullNode(node.pos)
elif attribute in (u'set', u'frozenset'): elif attribute in (u'set', u'frozenset'):
node = NameNode(node.pos, name=EncodedString(attribute)) node = NameNode(node.pos, name=EncodedString(attribute),
entry=self.current_env().builtin_scope().lookup_here(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
......
...@@ -12,6 +12,14 @@ def cython_set(): ...@@ -12,6 +12,14 @@ def cython_set():
assert set is cython.set assert set is cython.set
return cython.set return cython.set
def cython_set_override():
"""
>>> cython_set_override() is _set
True
"""
set = 1
return cython.set
def test_set_literal(): def test_set_literal():
""" """
>>> type(test_set_literal()) is _set >>> type(test_set_literal()) is _set
......
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