简体   繁体   English

Python 中的“from gremlin_python.process.graph_traversal import __”有什么作用?

[英]What does “from gremlin_python.process.graph_traversal import __” do in Python?

I am currently working on getting started with Janus Graph and Gremlin-Python.我目前正在着手使用 Janus Graph 和 Gremlin-Python。 I am going through the following example:我正在通过以下示例:

https://old-docs.janusgraph.org/latest/connecting-via-python.html https://old-docs.janusgraph.org/latest/connecting-via-python.html

In part 2 of the example, there is some strange syntax I have never seen in Python before:在示例的第 2 部分中,有一些我以前从未在 Python 中见过的奇怪语法:

from gremlin_python.process.graph_traversal import __

I understand how imports work and the from as well as import... but what on earth is import ___ ??我了解进口的工作原理以及进口和进口......但是import ___到底是什么?

My guess would be that it imports private functions... but I don't see any private functions in use in the example.我的猜测是它导入了私有函数……但我没有看到示例中使用了任何私有函数。 So what is this doing?那么这是在做什么呢?

The identifier __ has no special meaning in Python, aside from not being imported by default when using from module import * like all identifiers of the form _* .标识符__在 Python 中没有特殊含义,除了在使用from module import *时默认不导入,就像所有形式的标识符一样_* See the Python documentation on Reserved Identifiers .请参阅有关保留标识符的 Python 文档。

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

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