File: operator.py

package info (click to toggle)
python-cytoolz 1.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 588 kB
  • sloc: python: 3,913; makefile: 34
file content (22 lines) | stat: -rw-r--r-- 547 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from __future__ import absolute_import

import operator

from cytoolz.functoolz import curry


# Tests will catch if/when this needs updated
IGNORE = {
    "__abs__", "__index__", "__inv__", "__invert__", "__neg__", "__not__",
    "__pos__", "_abs", "abs", "attrgetter", "index", "inv", "invert",
    "is_none", "is_not_none", "itemgetter", "neg", "not_", "pos", "truth"
}

locals().update(
    {name: f if name in IGNORE else curry(f)
     for name, f in vars(operator).items() if callable(f)}
)

# Clean up the namespace.
del curry
del operator