aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
diff options
context:
space:
mode:
authorJohn Ericson <git@JohnEricson.me>2019-05-12 12:38:11 -0400
committerJussi Pakkanen <jpakkane@gmail.com>2019-05-15 14:21:47 +0300
commit4030e7cb7ad54dd2df0686f41459fc6293c8284f (patch)
treee7366f78785419ad7d301fb68bc4b508fba9079e /mesonbuild/mintro.py
parent7b8ef78bc0002d0327626c6218b793f87c2a5eb8 (diff)
downloadmeson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.zip
meson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.tar.gz
meson-4030e7cb7ad54dd2df0686f41459fc6293c8284f.tar.bz2
UserOption no longer has a name field.
This avoids the duplication where the option is stored in a dict at its name, and also contains its own name. In general, the maxim in programming is things shouldn't know their own name, so removed the name field just leaving the option's position in the dictionary as its name.
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r--mesonbuild/mintro.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 8c8aa15..cf55b6f 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -26,7 +26,7 @@ from .ast import IntrospectionInterpreter, build_target_functions, AstConditionL
from . import mlog
from .backend import backends
from .mparser import FunctionNode, ArrayNode, ArgumentNode, StringNode
-from typing import List, Optional
+from typing import Dict, List, Optional
import os
import pathlib
@@ -236,7 +236,7 @@ def list_buildoptions(coredata: cdata.CoreData) -> List[dict]:
add_keys(optlist, test_options, 'test')
return optlist
-def add_keys(optlist, options, section):
+def add_keys(optlist, options: Dict[str, cdata.UserOption], section):
keys = list(options.keys())
keys.sort()
for key in keys: