summaryrefslogtreecommitdiff
path: root/kconfiglib.py
diff options
context:
space:
mode:
authorUlf Magnusson <ulfalizer@gmail.com>2017-10-30 17:28:41 +0100
committerUlf Magnusson <ulfalizer@gmail.com>2017-10-30 17:30:25 +0100
commita6b67fd5888f5d31d34d3485ff85fe1fbd60ef74 (patch)
treea678a888005e2c9e8e73517a52a3e9863cece3c1 /kconfiglib.py
parent958a1ae750f1b1e814bcf434585c7c901473f116 (diff)
Explain how to get the integer value for int/hex
Diffstat (limited to 'kconfiglib.py')
-rw-r--r--kconfiglib.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/kconfiglib.py b/kconfiglib.py
index 6b6eff6..c9d015f 100644
--- a/kconfiglib.py
+++ b/kconfiglib.py
@@ -1993,13 +1993,16 @@ class Symbol(object):
when printing the symbol.
str_value:
- The value of the symbol as a string. Gives the string value for
- string/int/hex symbols. For bool/tristate symbols, gives "n", "m", or
- "y".
+ The value of the symbol as a string. Gives the value for string/int/hex
+ symbols. For bool/tristate symbols, gives "n", "m", or "y".
This is the symbol value that's used in relational expressions
(A = B, A != B, etc.)
+ Gotcha: For int/hex symbols, the exact format of the value must often be
+ preserved (e.g., when writing a .config file), hence why you can't get it
+ directly as an int. Do int(sym.str_value) to get the integer value.
+
tri_value:
The tristate value of the symbol as an integer. One of 0, 1, 2,
representing n, m, y. Always 0 (n) for non-bool/tristate symbols.