Skip to content

Commit e9bc1e1

Browse files
authored
Merge pull request #501 from eriknw/no_compatibility
Don't use compatibility module internally (it warns)
2 parents fd342da + 0869f05 commit e9bc1e1

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

toolz/functoolz.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
from functools import reduce, partial
22
import inspect
3-
import operator
4-
from operator import attrgetter
3+
import sys
4+
from operator import attrgetter, not_
55
from importlib import import_module
66
from textwrap import dedent
77
from types import MethodType
88

9-
from .compatibility import PYPY
109
from .utils import no_default
1110

1211

1312
__all__ = ('identity', 'apply', 'thread_first', 'thread_last', 'memoize',
1413
'compose', 'compose_left', 'pipe', 'complement', 'juxt', 'do',
1514
'curry', 'flip', 'excepts')
1615

16+
PYPY = hasattr(sys, 'pypy_version_info')
17+
1718

1819
def identity(x):
1920
""" Identity function. Return x
@@ -640,7 +641,7 @@ def complement(func):
640641
>>> isodd(2)
641642
False
642643
"""
643-
return compose(operator.not_, func)
644+
return compose(not_, func)
644645

645646

646647
class juxt(object):

0 commit comments

Comments
 (0)