Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 does yield support variable args?
#1
does yield support variable args like:
        yield *foo
i want to make a generator that can be made to pull date from some other generator and pass it through like maybe:
from time import sleep
def slowdowngenerator(*args,**kwargs):
    delay = kwargs.pop('delay',1/64)
    gener = kwargs.pop('gener',None)
    if not gener:
        return
    for *data in gener(*args,**kwargs):
        if delay:
            sleep(delay)
        yield *data
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  Problem about yield, please help!! cls0724 5 245 Apr-08-2020, 05:37 PM
Last Post: deanhystad
  is there a way: repeat key word args Skaperen 2 243 Feb-03-2020, 06:03 PM
Last Post: Skaperen
  generator function that yield from a list buran 9 826 Jun-04-2019, 10:26 PM
Last Post: snippsat
  yield help chakox 5 794 Apr-13-2019, 09:42 PM
Last Post: chakox
  Multiple calls to Python interpreter embedded in C++ application yield segmentation f mmoelle1 0 585 Mar-21-2019, 08:54 PM
Last Post: mmoelle1
  1 == 1 seems to yield false zatlas1 3 588 Jan-07-2019, 01:49 PM
Last Post: Gribouillis
  Yield Keyword 6pathsMadara 6 1,006 Aug-24-2018, 11:43 AM
Last Post: 6pathsMadara
  what does "yield '\n'" do? 2sky 2 1,405 Jan-30-2018, 09:35 AM
Last Post: 2sky
  Passing string args to Popen CardBoy 3 1,816 Jan-16-2018, 09:22 AM
Last Post: Gribouillis
  subprocess with args haye 0 1,977 Oct-23-2017, 10:54 AM
Last Post: haye

Forum Jump:


Users browsing this thread: 1 Guest(s)