Skip to content

Instantly share code, notes, and snippets.

@dw

dw/a.py

Created Sep 2, 2016
Embed
What would you like to do?
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