[issue13245] sched.py kwargs addition and default time functions

2011-10-22 Thread Chris Clark

New submission from Chris Clark :

I ended up implementing my own sched.py equivalent as I needed kwargs support. 
This is my attempt to improve the stdlib, so I can throw my module way ;-)

Added kwargs support, and made "argument" optional. "argument" is still named 
argument, I would like to rename this args but I'm unclear on the backwards 
compat rules for stdlib, in theory it should be fine unless someone has code 
that treats argument as a keyword arg).

The scheduler init no long requires timer functions to be provided, it defaults 
to time.time, time.sleep as a helper to reduce repeated code for callers. This 
still allows callers to provide custom timer routines.

I added a few (non exhaustive) tests for the new additions.

It looks like there are a few pep8 improvements could be made to sched.py but 
I've not done that to reduce diffs and make it easier to see what I changed. 
Similar doc strings could be made more clear.

I snuck in a hack to the test so that the full test suite isn't needed, I do 
not expect that to be accepted :-) I don't have enough network bandwidth to 
pull the whole hg repo so I ended up pulling the tip version for 2.7 of sched 
and its test (as of 2011-10-22 this is 5110d723fbb1)

--
components: Library (Lib)
files: kwargs_def_timer.patch
keywords: patch
messages: 146180
nosy: clach04
priority: normal
severity: normal
status: open
title: sched.py kwargs addition and default time functions
type: feature request
versions: Python 2.7
Added file: http://bugs.python.org/file23496/kwargs_def_timer.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13245] sched.py kwargs addition and default time functions

2011-10-22 Thread Ezio Melotti

Ezio Melotti  added the comment:

Hi, thanks for the patch!
2.7 receives only bug fixes, so your patch can't be applied to 2.7.
If the feature is accepted it can go to 3.3 though.

--
nosy: +ezio.melotti
stage:  -> patch review
versions: +Python 3.3 -Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13245] sched.py kwargs addition and default time functions

2011-11-21 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

I think this should go in.
I'm going to provide a slighly modified version of the attached patch which 
includes document changes and get rid of some unit tests which are not really 
necessary in my opinion.

--
nosy: +giampaolo.rodola

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13245] sched.py kwargs addition and default time functions

2011-11-21 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Updated patch in attachment.

--
Added file: http://bugs.python.org/file23745/issue13245.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13245] sched.py kwargs addition and default time functions

2011-11-22 Thread Mark Dickinson

Mark Dickinson  added the comment:

+1 to kwargs support in sched.  I've also ended up modifying sched.py to 
support this in the past.

--
nosy: +mark.dickinson

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13245] sched.py kwargs addition and default time functions

2011-11-22 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Checked in as f1a21f2e3bec and dc52db0fa2e5.
Thanks.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com