Python名称空间说明 [英] Explanation of Python namespaces

查看:71
本文介绍了Python名称空间说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找有关Python名称空间的良好介绍.我发现本教程很好,但是我敢肯定还有更多内容比这个故事更重要.

I am looking for a good introduction to Python namespaces. I found this tutorial to be good, but I'm sure there is more to the story than that.

Python参考包含信息,但是很难阅读.

The Python reference contains information but it's quite hard to read.

请解释python名称空间.在您的解释中,请包括完整的示例以说明各种用途.

Please explain python namespaces. In your explanation please include complete examples that show the various uses.

推荐答案

它们实际上并不那么复杂.导入机制可能会有些复杂,并且现在有了相对导入,它可能会变得更加棘手,但就实际的名称空间及其在代码中的解析方式而言,该教程似乎非常全面.

They're really not all that complex. The import mechanisms can be somewhat complex and with relative imports now it can get even a bit more tricky, but as far as actual namespaces and how they're resolved in code, that tutorial seems to be pretty comprehensive.

语言参考总是很不错,结尾是-但是,对于刚起步的人来说,这通常过于矫kill过正.

The language reference is always kind of the be-all, end-all however, but it's often overkill for those starting out.

如果您对某些事情的工作方式有任何特定的疑问,您将在这里得到很好的答复.

If you have any specific questions as to how certain things work, you'll get good responses on here.

这篇关于Python名称空间说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆