1from distutils import cmd, core, version
2
3def import1():
4    """
5    >>> import1() == (cmd, core, version)
6    True
7    """
8    from distutils import (
9
10        cmd,
11
12core,                    version)
13    return cmd, core, version
14
15
16def import2():
17    """
18    >>> import2() == (cmd, core, version)
19    True
20    """
21    from distutils import (cmd,
22
23core,
24
25
26                           version
27)
28    return cmd, core, version
29
30
31def import3():
32    """
33    >>> import3() == (cmd, core, version)
34    True
35    """
36    from distutils import (cmd, core,version)
37    return cmd, core, version
38
39def import4():
40    """
41    >>> import4() == (cmd, core, version)
42    True
43    """
44    from distutils import cmd, core, version
45    return cmd, core, version
46
47
48
49def typed_imports():
50    """
51    >>> typed_imports()
52    True
53    True
54    an integer is required
55    Expected type, got int
56    """
57
58    import sys
59    import types
60    cdef long maxunicode
61    cdef type t
62
63    from sys import maxunicode
64    print(maxunicode == sys.maxunicode)
65    from types import ModuleType as t
66    print(t is types.ModuleType)
67
68    try:
69        from sys import version_info as maxunicode
70    except TypeError, e:
71        print(e)
72
73    try:
74        from sys import maxunicode as t
75    except TypeError, e:
76        print(e)
77