本文整理汇总了Python中utils.compile_source函数的典型用法代码示例。如果您正苦于以下问题:Python compile_source函数的具体用法?Python compile_source怎么用?Python compile_source使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了compile_source函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_bad_syntax_9
def test_bad_syntax_9():
source = dedent("""\
template Main():
alias value
""")
compile_source(source, 'Main')
示例2: test_syntax_10
def test_syntax_10():
source = dedent("""\
template Main(A=None):
pass
""")
compile_source(source, 'Main')
示例3: test_bad_syntax_3
def test_bad_syntax_3():
source = dedent("""\
template Main:
pass
""")
compile_source(source, 'Main')
示例4: test_bad_syntax_14
def test_bad_syntax_14():
source = dedent("""\
template Main(*C, A=None)
pass
""")
compile_source(source, 'Main')
示例5: test_bad_syntax_8
def test_bad_syntax_8():
source = dedent("""\
template Main():
event value
""")
compile_source(source, 'Main')
示例6: test_syntax_9
def test_syntax_9():
source = dedent("""\
template Main(A, B: 12, *C):
pass
""")
compile_source(source, 'Main')
示例7: test_bad_syntax_17
def test_bad_syntax_17():
source = dedent("""\
template Main():
Foo(): a, *c
""")
compile_source(source, 'Main')
示例8: test_syntax_14
def test_syntax_14():
source = dedent("""\
template Main(A, B: 12, C=None, *D):
pass
""")
compile_source(source, 'Main')
示例9: test_bad_syntax_19
def test_bad_syntax_19():
source = dedent("""\
template Main(Arg):
const Arg = 12
""")
compile_source(source, 'Main')
示例10: test_bad_syntax_12
def test_bad_syntax_12():
source = dedent("""\
template Main(A, B=None, C):
pass
""")
compile_source(source, 'Main')
示例11: test_syntax_3
def test_syntax_3():
source = dedent("""\
template Main():
const value = 12
""")
compile_source(source, 'Main')
示例12: test_bad_syntax_18
def test_bad_syntax_18():
source = dedent("""\
template Main():
Field: a: pass
Foo(): a: pass
""")
compile_source(source, 'Main')
示例13: test_bad_syntax_20
def test_bad_syntax_20():
source = dedent("""\
template Main(Arg):
const Args = 12
Field: Args: pass
""")
compile_source(source, 'Main')
示例14: test_syntax_15
def test_syntax_15():
source = dedent("""\
template Main(A, B, C):
Field:
pass
PushButton:
pass
""")
compile_source(source, 'Main')
示例15: test_bad_instantiation_4
def test_bad_instantiation_4():
source = dedent("""\
template Other(A):
pass
template Other(A):
pass
""")
compile_source(source, 'Main')