用法:
is_namespace()
如果名称绑定引入了新的命名空间,则返回
True
。如果名称被用作函数或类语句的目标,这将是正确的。
例如:
>>> table = symtable.symtable("def some_func(): pass", "string", "exec") >>> table.lookup("some_func").is_namespace() True
请注意,单个名称可以绑定到多个对象。如果结果是
True
,则名称也可能绑定到其他不引入新命名空间的对象,如 int 或列表。
相关用法
- Python sympy.rf()用法及代码示例
- Python sympy.stats.GammaInverse()用法及代码示例
- Python sympy.integrals.transforms.mellin_transform()用法及代码示例
- Python sympy.replace()用法及代码示例
- Python sympy from_rgs()用法及代码示例
- Python sympy.stats.MultivariateT()用法及代码示例
- Python sympy.stats.Chi()用法及代码示例
- Python sympy.udivisor_sigma()用法及代码示例
- Python sympy.antidivisors()用法及代码示例
- Python sympy.as_poly()用法及代码示例
- Python sympy.stats.MultivariateBeta()用法及代码示例
- Python sympy.stats.MultivariateEwens()用法及代码示例
- Python sympy.expand_power_base()用法及代码示例
- Python sympy.sec()用法及代码示例
- Python sympy Partition()用法及代码示例
- Python sympy rank()用法及代码示例
- Python sympy.stats.NegativeMultinomial()用法及代码示例
- Python sympy.sqrt()用法及代码示例
- Python sympy.integrals.rationaltools.ratint_logpart()用法及代码示例
- Python sympy.ff()用法及代码示例
注:本文由纯净天空筛选整理自python.org大神的英文原创作品 symtable.Symbol.is_namespace。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。