Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use collections.abc for Mapping #2750

Merged
merged 3 commits into from
Mar 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion gensim/corpora/dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@

from __future__ import with_statement

from collections import Mapping, defaultdict
from collections import defaultdict
from collections.abc import Mapping
import sys
import logging
import itertools
Expand Down
3 changes: 2 additions & 1 deletion gensim/models/doc2vec.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@
except ImportError:
from Queue import Queue # noqa:F401

from collections import namedtuple, defaultdict, Iterable
from collections import namedtuple, defaultdict
from collections.abc import Iterable
from timeit import default_timer

from numpy import zeros, float32 as REAL, empty, ones, \
Expand Down
2 changes: 1 addition & 1 deletion gensim/models/fasttext.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
import numpy as np
from numpy import ones, vstack, float32 as REAL
import six
from collections import Iterable
from collections.abc import Iterable

import gensim.models._fasttext_bin

Expand Down
3 changes: 1 addition & 2 deletions gensim/test/test_corpora_dictionary.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
Unit tests for the `corpora.Dictionary` class.
"""


from collections import Mapping
from collections.abc import Mapping
from itertools import chain
import logging
import unittest
Expand Down