From 0869f05c5dfa35e252a3009f2f8130147b2cb3ae Mon Sep 17 00:00:00 2001 From: Erik Welch Date: Thu, 24 Sep 2020 09:56:45 -0500 Subject: [PATCH] Don't use compatibility module internally (it warns) --- toolz/functoolz.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/toolz/functoolz.py b/toolz/functoolz.py index 21a7d3be..c568aae8 100644 --- a/toolz/functoolz.py +++ b/toolz/functoolz.py @@ -1,12 +1,11 @@ from functools import reduce, partial import inspect -import operator -from operator import attrgetter +import sys +from operator import attrgetter, not_ from importlib import import_module from textwrap import dedent from types import MethodType -from .compatibility import PYPY from .utils import no_default @@ -14,6 +13,8 @@ 'compose', 'compose_left', 'pipe', 'complement', 'juxt', 'do', 'curry', 'flip', 'excepts') +PYPY = hasattr(sys, 'pypy_version_info') + def identity(x): """ Identity function. Return x @@ -640,7 +641,7 @@ def complement(func): >>> isodd(2) False """ - return compose(operator.not_, func) + return compose(not_, func) class juxt(object):