Commit c2fea5bf authored by Stefan Behnel's avatar Stefan Behnel

Merge branch '0.29.x'

parents ead396c5 ae4e39db
......@@ -1421,6 +1421,9 @@ class CVarDefNode(StatNode):
self.entry.type.create_to_py_utility_code(env)
self.entry.create_wrapper = True
else:
if self.overridable:
warning(self.pos, "cpdef variables will not be supported in Cython 3; "
"currently they are no different from cdef variables", 2)
if self.directive_locals:
error(self.pos, "Decorators can only be followed by functions")
self.entry = dest_scope.declare_var(
......
# tag: warnings
cpdef str a = "123"
cpdef b = 2
cdef class C:
cpdef float c
def func():
cpdef d=C()
return d
_WARNINGS = """
3:6: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables
4:6: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables
7:10: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables
10:10: cpdef variables will not be supported in Cython 3; currently they are no different from cdef variables
"""
......@@ -41,8 +41,6 @@ ctypedef int my_int
######## a.pyx ########
from other cimport (
A,
foo,
......@@ -58,8 +56,6 @@ def call_other_foo():
x = other.foo # GH4000 - failed because other was untyped
return call_fooptr(x) # check that x is correctly resolved as a function pointer
print(other.A, other.foo(10), call_other_foo())
from pkg cimport sub
......
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