简体   繁体   English

为什么在Python中可以省略某些完全引用的包名称?

[英]Why some package name of a complete referring could be omitted in python?

I have had this 'not so important' question in many conditions, and the specific question I meet most recently is: 在许多情况下,我都遇到了这个“不太重要”的问题,而我最近遇到的具体问题是:

import tensorflow as tf
help(tf.feature_column.numeric_column)

[output]:
Help on function numeric_column in module 
tensorflow.python.feature_column.feature_column: 
...

So, here is my question. 所以,这是我的问题。 The complete reference of 的完整参考

'tf.feature_column.numeric_column'

is

'tensorflow.python.feature_column.feature_column'

according to its docstrings. 根据其文档字符串。 Why the 'python' package name could be omitted? 为什么可以省略“ python”软件包名称?

I thought that python may be able to find package/module in next hierarchy automatically? 我认为python可能能够自动在下一个层次结构中找到包/模块?

Tensorflow将python模块导入其init.py文件

from tensorflow.python import *

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM