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


Possibly Related Threads…
Thread Author Replies Views Last Post
  yield question with append gnomegordon 2 681 Dec-04-2024, 06:47 PM
Last Post: gnomegordon
  yield from akbarza 4 1,723 Apr-19-2024, 07:58 PM
Last Post: DeaD_EyE
  yield usage as statement or expression akbarza 5 2,010 Oct-23-2023, 11:43 AM
Last Post: Gribouillis
  Using list comprehension with 'yield' in function tester_V 5 3,523 Apr-02-2023, 06:31 PM
Last Post: tester_V
Question How to compare two parameters in a function that has *args? Milan 4 2,767 Mar-26-2023, 07:43 PM
Last Post: Milan
  *args implementation and clarification about tuple status amjass12 10 6,171 Jul-07-2021, 10:29 AM
Last Post: amjass12
  [SOLVED] Good way to handle input args? Winfried 2 2,751 May-18-2021, 07:33 PM
Last Post: Winfried
  Two Questions, *args and //= beginner721 8 5,008 Feb-01-2021, 09:11 AM
Last Post: buran
  Yield generator weird output Vidar567 8 4,969 Nov-23-2020, 10:59 PM
Last Post: deanhystad
  Trying to access next element using Generator(yield) in a Class omm 2 2,747 Oct-19-2020, 03:36 PM
Last Post: omm

Forum Jump:

User Panel Messages

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