Python 为什么networkx中缺少parse_graph6?

Python 为什么networkx中缺少parse_graph6?,python,networkx,Python,Networkx,networkx说有一个用于解析graph6字符串的函数,名为parse_graph6 networkx.readwrite.graph6.parse_graph6,但它似乎不存在。这个功能消失了,还是我做错了什么 jack@hitch:~$ pip show networkx | grep Version Version: 2.1 jack@hitch:~$ python Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) [GCC 7.3.0

networkx说有一个用于解析graph6字符串的函数,名为parse_graph6 networkx.readwrite.graph6.parse_graph6,但它似乎不存在。这个功能消失了,还是我做错了什么

jack@hitch:~$ pip show networkx | grep Version
Version: 2.1
jack@hitch:~$ python
Python 2.7.15rc1 (default, Nov 12 2018, 14:31:15) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import networkx
>>> dir(networkx.readwrite.graph6)
['NetworkXError', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '_generate_graph6_bytes', 'data_to_n', 'from_graph6_bytes', 'islice', 'n_to_data', 'not_implemented_for', 'nx', 'open_file', 'read_graph6', 'sys', 'to_graph6_bytes', 'write_graph6', 'write_graph6_file']

>>> networkx.readwrite.graph6.parse_graph6
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'parse_graph6'
>>> 
如图所示,parse_graph6重命名为from_graph6_字节


在大于2.0的networkx版本中,将使用from\u graph6\u字节。

提及networkx.readwrite.graph6.parse\u graph6是否会导致任何错误?根据,结果列表[由dir返回]不一定完整。是的,提及它会给出AttributeError。更新见上文