From 6341d1382e0ab14043396e8a9fbb18c27a3e236c Mon Sep 17 00:00:00 2001 From: ymdatta Date: Sun, 28 Oct 2018 17:21:39 +0530 Subject: [PATCH] Add support for optparse's 'float' and 'complex' types. This helps normalize_from_setuptools, to handle all optparse's standard-option-types. Fixes #452 --- src/flake8/options/manager.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/flake8/options/manager.py b/src/flake8/options/manager.py index 3f4e883..0ded13a 100644 --- a/src/flake8/options/manager.py +++ b/src/flake8/options/manager.py @@ -156,6 +156,10 @@ class Option(object): value = self.normalize(value) if self.type == "int" or self.action == "count": return int(value) + elif self.type == "float": + return float(value) + elif self.type == "complex": + return complex(value) if self.action in ("store_true", "store_false"): value = str(value).upper() if value in ("1", "T", "TRUE", "ON"):