8000 CLN: Remove redundant definitions in pandas.compat (filter, map, range, etc.) by jschendel · Pull Request #25845 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

CLN: Remove redundant definitions in pandas.compat (filter, map, range, etc.) #25845

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

Merged
merged 2 commits into from
Mar 23, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Also remove ResourceWarning
  • Loading branch information
jschendel committed Mar 23, 2019
commit 583841bde228a3a427476577098b997e7a9b61ec
8 changes: 1 addition & 7 deletions pandas/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Cross-compatible functions for Python 2 and 3.

Key items to import for 2/3 compatible code:
* iterators: range(), map(), zip(), filter(), reduce()
* iterators: reduce()
* lists: lrange(), lmap(), lzip(), lfilter()
* unicode: u() [no unicode builtin in Python 3]
* longs: long (int in Python 3)
Expand Down Expand Up @@ -298,9 +298,6 @@ def set_function_name(f, name, cls):
name=name)
f.__module__ = cls.__module__
return f

ResourceWarning = ResourceWarning

else:
string_types = basestring,
integer_types = (int, long)
Expand Down Expand Up @@ -356,9 +353,6 @@ def set_function_name(f, name, cls):
f.__name__ = name
return f

class ResourceWarning(Warning):
pass

string_and_binary_types = string_types + (binary_type,)


Expand Down
3 changes: 1 addition & 2 deletions pandas/io/stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
from pandas._libs.lib import infer_dtype
from pandas._libs.tslibs import NaT, Timestamp
from pandas._libs.writers import max_len_string_array
from pandas.compat import (
BytesIO, ResourceWarning, lmap, lrange, lzip, string_types, text_type)
from pandas.compat import BytesIO, lmap, lrange, lzip, string_types, text_type
from pandas.util._decorators import Appender, deprecate_kwarg

from pandas.core.dtypes.common import (
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/io/test_stata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
import pytest

import pandas.compat as compat
from pandas.compat import ResourceWarning, iterkeys
from pandas.compat import iterkeys

from pandas.core.dtypes.common import is_categorical_dtype

Expand Down
2 changes: 1 addition & 1 deletion pandas/util/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
_RAISE_NETWORK_ERROR_DEFAULT = False

# set testing_mode
_testing_mode_warnings = (DeprecationWarning, compat.ResourceWarning)
_testing_mode_warnings = (DeprecationWarning, ResourceWarning)


def set_testing_mode():
Expand Down
0