import select __old_select = select.select def new_select(r, w, x, t): __old_select(r, w, x, t) select.select = new_select import selectors s = selectors.SelectSelector() # Fails with: TypeError: new_select() takes 4 positional arguments but 5 were given s.select(0)