mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-01 03:26:52 +00:00
Merge branch 'master' into 'master'
Add support for optparse's 'float' and 'complex' types. Closes #452 See merge request pycqa/flake8!261
This commit is contained in:
commit
0f3f4ff9b4
2 changed files with 14 additions and 0 deletions
|
|
@ -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"):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue