You can mix kwargs and **kwargs,you realize, right?


On Tue, Jan 21, 2014 at 12:16 PM, CBWhiz <notifications@github.com> wrote:

> In fsq/scan.py:
>
> > @@ -118,6 +118,28 @@ def next(self):
> >          # if we break through loop with no exception, we're done
> >          raise StopIteration()
> >
> > +def scan_forever(queue, *args, **kwargs):
> > +    """Return an infinite iterator over an fsq queue that blocks waiting
> > +       for the queue trigger. Work is yielded as FSQWorkItem objects when
> > +       available, assuming the default generator (FSQScanGenerator) is
> > +       in use.
> > +
> > +       Essentially, this function wraps fsq.scan() and blocks for more work.
> > +
> > +       It takes all the same parameters as scan(), plus process_once_now,
> > +       which is a boolean to determine if an initial .scan() is run before
> > +       listening to the trigger. This argument defaults to True.
> > +    """
> > +    process_once_now = kwargs.get('process_once_now', True)
>
> I did not use process_once_now in the constructor, because that would
> change the positioning of arguments. I want this to be a keyword only
> argument to allow a swap between scan / scan_forever without positional
> argument order shuffling.
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/axialmarket/fsq/pull/6/files#r9044877>
> .
>