From 7b7e937602f4c7859a87fc80a20b4a455b355ba0 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Sun, 10 May 2015 01:53:31 +0300 Subject: [PATCH] operator: Add, with attrgetter() implementation. --- operator/operator.py | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 operator/operator.py diff --git a/operator/operator.py b/operator/operator.py new file mode 100644 index 00000000..7b8b0998 --- /dev/null +++ b/operator/operator.py @@ -0,0 +1,5 @@ +def attrgetter(attr): + assert "." not in attr + def _attrgetter(obj): + return getattr(obj, attr) + return _attrgetter