From 65d1d21d2e797fe2fdab1eeb9c340298745737b0 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 28 Sep 2014 00:43:08 +0200 Subject: [PATCH] Always use a list for namedtuple. --- doc/TODO | 1 - qutebrowser/browser/hints.py | 2 +- qutebrowser/commands/command.py | 2 +- qutebrowser/utils/rfc6266.py | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/doc/TODO b/doc/TODO index 60a14d2f1..a4cdaaabd 100644 --- a/doc/TODO +++ b/doc/TODO @@ -127,7 +127,6 @@ style tree? - Stuff under scripts/ (especially generate_doc and run_checks) could use a rewrite. -- Always use a list as argument for namedtuple? - Use separate logger for config - Use unittest.Mock and especially unittest.patch more. - Use decorators for on_config_changed diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index a14d0d0d1..7848bd59d 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -34,7 +34,7 @@ from qutebrowser.commands import userscripts, cmdexc, cmdutils from qutebrowser.utils import usertypes, log, qtutils, message, objreg -ElemTuple = collections.namedtuple('ElemTuple', 'elem, label') +ElemTuple = collections.namedtuple('ElemTuple', ['elem', 'label']) Target = usertypes.enum('Target', ['normal', 'tab', 'tab_bg', 'yank', diff --git a/qutebrowser/commands/command.py b/qutebrowser/commands/command.py index 1197629d4..0237c2295 100644 --- a/qutebrowser/commands/command.py +++ b/qutebrowser/commands/command.py @@ -57,7 +57,7 @@ class Command: """ AnnotationInfo = collections.namedtuple('AnnotationInfo', - 'kwargs, typ, name, flag') + ['kwargs', 'typ', 'name', 'flag']) ParamType = usertypes.enum('ParamType', ['flag', 'positional']) def __init__(self, name, split, hide, instance, completion, modes, diff --git a/qutebrowser/utils/rfc6266.py b/qutebrowser/utils/rfc6266.py index 79b1f9d40..f9b1f7e4b 100644 --- a/qutebrowser/utils/rfc6266.py +++ b/qutebrowser/utils/rfc6266.py @@ -209,7 +209,7 @@ class ContentDispositionValue: peg.optional(';')) -LangTagged = collections.namedtuple('LangTagged', 'string langtag') +LangTagged = collections.namedtuple('LangTagged', ['string', 'langtag']) class DuplicateParamError(Exception):