I'm getting an underline in some variables on Android Studio (in this case on the 'position' variable). I think it's not an error because the application runs perfectly and the compiler passes everything ok. I'm wondering what does that mean?
Variable name may not start with a digit or underscore, and may not end with an underscore. Double underscores are not permitted in variable name. Variable names may not be longer than 32 characters and are required to be shorter for some question types: multiselect, GPS location and some other question types.
A single leading underscore in front of a variable, a function, or a method name means that these objects are used internally. This is more of a syntax hint to the programmer and is not enforced by the Python interpreter which means that these objects can still be accessed in one way on another from another script.
An underscore in front usually indicates an instance variable as opposed to a local variable. It's merely a coding style that can be omitted in favor of "speaking" variable names and small classes that don't do too many things.
The underscore prefix is meant as a hint to another programmer that a variable or method starting with a single underscore is intended for internal use. This convention is defined in PEP 8. This isn't enforced by Python. Python does not have strong distinctions between “private” and “public” variables like Java does.
It could be a sign of "Reassigned parameter"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With