Python Forum
does yield support variable args?
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
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
does yield support variable args? - by Skaperen - Mar-03-2020, 02:44 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  yield usage as statement or expression akbarza 5 796 Oct-23-2023, 11:43 AM
Last Post: Gribouillis
  Using list comprehension with 'yield' in function tester_V 5 1,243 Apr-02-2023, 06:31 PM
Last Post: tester_V
Question How to compare two parameters in a function that has *args? Milan 4 1,259 Mar-26-2023, 07:43 PM
Last Post: Milan
  *args implementation and clarification about tuple status amjass12 10 3,994 Jul-07-2021, 10:29 AM
Last Post: amjass12
  [SOLVED] Good way to handle input args? Winfried 2 2,055 May-18-2021, 07:33 PM
Last Post: Winfried
  Two Questions, *args and //= beginner721 8 3,481 Feb-01-2021, 09:11 AM
Last Post: buran
  Yield generator weird output Vidar567 8 3,261 Nov-23-2020, 10:59 PM
Last Post: deanhystad
  Trying to access next element using Generator(yield) in a Class omm 2 1,965 Oct-19-2020, 03:36 PM
Last Post: omm
  Yield statement question DPaul 6 2,504 Sep-26-2020, 05:18 PM
Last Post: DPaul
  Problem about yield, please help!! cls0724 5 2,853 Apr-08-2020, 05:37 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020