0
2つのpythonパッケージcollections
と_collections
の違いは何ですか?私は_collections
がおそらくcollections
の私的実装であると思います。しかし、私はより広範かつ正確な説明を求めていました。私は両方のコードがコードで使用されているのを見ました。"collections"パッケージと "_collections"の違い(アンダースコア付き)
from _collections import defaultdict
dd = defaultdict(int)
dd['a'] += 1
print(dd)
[out]: defaultdict(<class 'int'>, {'a': 1})
from _collections import defaultdict
dd = defaultdict(int)
dd['a'] += 1
print(dd)
[out]: defaultdict(<class 'int'>, {'a': 1}