I am kind of new to Python, so I am trying to read over existing code. I am a little confused on the syntax of this though.
For example:
rlist, _, _ = select.select(sockets, [], [])
I understand that select.select() takes 3 lists (and I assume [] just means empty list), but is the _ used to denote a placeholder of some sort?
It’s just the name of a variable! Usually people use
_for variables that are temporary or insignificant.As other people have stated,
_is a common alias for gettext, a translation library. You can identify when it’s being used as gettext if you see it called as a function, eg._('Hello, world!').Protip: In the python console it can be used to retrieve the result of the last statement.