[issue11073] threading.Thread documentation can be improved

2011-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: You don't have to use any staticmethod here (actually, staticmethod is an anti-pattern in Python). Just write: class Foo(): def __init__(self): self.thread = Thread(target=self.runner) self.thread.start() def runner(self): # blah, bl

[issue11073] threading.Thread documentation can be improved

2011-01-31 Thread Brian Curtin
Brian Curtin added the comment: > It was not immediately clear from the documentation if my runner() method > should be declared static or not. The doc doesn't mention static methods at all, and my uses and others that I've seen have never used static methods. -- nosy: +brian.curtin

[issue11073] threading.Thread documentation can be improved

2011-01-31 Thread Roy Smith
Roy Smith added the comment: Here's the code I ended up writing: class Foo(): def __init__(self): self.thread = Thread(target=Foo.runner, args=[self]) self.thread.start() @staticmethod def runner(self): # blah, blah, blah It was not immediately clear from the docu

[issue11073] threading.Thread documentation can be improved

2011-01-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Roy, it's not clear what you're after. What is it that you think is special about the way the target is called? -- nosy: +rhettinger ___ Python tracker __

[issue11073] threading.Thread documentation can be improved

2011-01-31 Thread R. David Murray
R. David Murray added the comment: I still don't understand. I haven't used threading much, but I don't believe I've ever used a static method with it. -- ___ Python tracker _

[issue11073] threading.Thread documentation can be improved

2011-01-30 Thread Roy Smith
Roy Smith added the comment: What I meant was whether target should be declared as @staticmethod or not. -- ___ Python tracker ___ __

[issue11073] threading.Thread documentation can be improved

2011-01-30 Thread R. David Murray
R. David Murray added the comment: I have no idea what "a static context" means, so it wouldn't make it any clearer to me. Can you explain further what your confusion is? -- nosy: +r.david.murray type: -> feature request versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

[issue11073] threading.Thread documentation can be improved

2011-01-30 Thread Roy Smith
New submission from Roy Smith : The documentation for the threading.Thread constructor says: "target is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called." This could be improved by explicitly stating that target is called in a static context.