Skip to content

Instantly share code, notes, and snippets.

@dw
Created September 2, 2016 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dw/9f92b1da4aed5646335a37319a135d63 to your computer and use it in GitHub Desktop.
Save dw/9f92b1da4aed5646335a37319a135d63 to your computer and use it in GitHub Desktop.
def flags(names):
"""Return the result of ORing a set of (space separated) :py:mod:`termios`
module constants together."""
return sum(getattr(termios, name) for name in names.split())
def flags(names):
"""Return the result of ORing a set of (space separated) :py:mod:`termios`
module constants together."""
n = 0
for name in names.split():
n |= getattr(termios, name)
return n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment