Message49769
Logged In: YES
user_id=250749
Thanks for the comments.
As implemented, the function is both a getter and
(optionally) a setter which makes attempting to use a
"get"/"set" prefix
awkward.
I chose this approach to make it a little simpler to support
temporary changes. I did consider using a module
attribute/variable, but it is slightly more unwieldy for
this case:
old_size = thread.stack_size(new_size)
...
thread.stack_size(old_size)
vs
old_size = thread.stack_size
thread.stack_size = new_size
...
thread.stack_size = old_size
or (using get/set accessors)
old_size = thread.get_stacksize()
thread.set_stacksize(new_size)
...
thread.set_stacksize(old_size)
I think an argument can be made for passing on the
"get"/"set" naming consistency based on the guidelines in
PEP 8. While I have a preference for what I've implemented,
I'm more interested in getting the functionality in than
debating its decor. If there's a strong view about these
issues, I'm prepared to revise the patch accordingly.
I don't believe that the functionality belongs anywhere else
than the thread module, except possibly shadowing it in the
threading module, as it is highly specific to thread
support. The sys module seems more appropriate for general
knobs, and only for specific knobs when there is no other
choice IMO. Doing it outside the thread module also
complicates the implementation, which I was trying to keep
as simple as I could.
|
|
Date |
User |
Action |
Args |
2007-08-23 15:47:00 | admin | link | issue1454481 messages |
2007-08-23 15:47:00 | admin | create | |
|