From 814e2decd190d78b588dd775c1531dacd6bc38c6 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 10 May 2019 19:08:16 +0200 Subject: Improve the 'referenced' docstring - Point out why dependencies from surrounding if's and menus are included - Clarify that .referenced isn't transitive. Only "direct" references are included. - Give a hint about direct dependencies and expr_items() Prompted by https://github.com/ulfalizer/Kconfiglib/issues/69. --- kconfiglib.py | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'kconfiglib.py') diff --git a/kconfiglib.py b/kconfiglib.py index bfcefec..e31b4c8 100644 --- a/kconfiglib.py +++ b/kconfiglib.py @@ -3857,9 +3857,31 @@ class Symbol(object): A set() with all symbols and choices referenced in the properties and property conditions of the symbol. - Also includes dependencies inherited from surrounding menus and if's. + Also includes dependencies from surrounding menus and if's, because those + get propagated to the symbol (see the 'Intro to symbol values' section in + the module docstring). + Choices appear in the dependencies of choice symbols. + For the following definitions, only B and not C appears in A's + 'referenced'. To get transitive references, you'll have to recursively + expand 'references' until no new items appear. + + config A + bool + depends on B + + config B + bool + depends on C + + config C + bool + + See the Symbol.direct_dep attribute if you're only interested in the + direct dependencies of the symbol (its 'depends on'). You can extract the + symbols in it with the global expr_items() function. + env_var: If the Symbol has an 'option env="FOO"' option, this contains the name ("FOO") of the environment variable. None for symbols without no @@ -4729,7 +4751,9 @@ class Choice(object): A set() with all symbols referenced in the properties and property conditions of the choice. - Also includes dependencies inherited from surrounding menus and if's. + Also includes dependencies from surrounding menus and if's, because those + get propagated to the choice (see the 'Intro to symbol values' section in + the module docstring). is_optional: True if the choice has the 'optional' flag set on it and can be in -- cgit v1.2.3