File: cimport_attributes.pyx

package info (click to toggle)
cython 3.0.11%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 19,092 kB
  • sloc: python: 83,539; ansic: 18,831; cpp: 1,402; xml: 1,031; javascript: 511; makefile: 403; sh: 204; sed: 11
file content (32 lines) | stat: -rw-r--r-- 915 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# mode: error
# tag: cpp


cimport libcpp
print libcpp.no_such_attribute

cimport libcpp.map
print libcpp.map.no_such_attribute

from libcpp cimport vector
print vector.no_such_attribute

from libcpp cimport vector as my_vector
print my_vector.no_such_attribute

from libcpp cimport vector as my_vector_with_shadow
from libcpp import vector as my_vector_with_shadow
print my_vector_with_shadow.python_attribute   # OK (if such a module existed at runtime)

# Other ordering
from libcpp import map as my_map_with_shadow
from libcpp cimport map as my_map_with_shadow
print my_map_with_shadow.python_attribute   # OK (if such a module existed at runtime)


_ERRORS = u"""
6:12: cimported module has no attribute 'no_such_attribute'
9:16: cimported module has no attribute 'no_such_attribute'
12:12: cimported module has no attribute 'no_such_attribute'
15:15: cimported module has no attribute 'no_such_attribute'
"""