clustershell icon indicating copy to clipboard operation
clustershell copied to clipboard

Add task_self() next gen

Open thiell opened this issue 12 years ago • 1 comments

In ClusterShell code examples, most of the time, task_self() is copied in a local task variable because this is nicer to use. That means that task_self() name is not a good one and the first thing people do is the rename it!

In consequence, a better name should be find and available to refer to the same concept.

  • this should not be a function!

Maybe:

  • mytask (it sounds like a bit a VisualBasic :))
  • ... ?

thiell avatar Mar 03 '12 16:03 thiell

[st-cea] I prefer curtask. But it cannot be a simple variable as its value would get the task object associated to the thread importing the module. Moreover, it's not trivial to add a property to a module.

  • http://docs.python.org/library/functions.html#property
  • http://stackoverflow.com/questions/880530/can-python-modules-have-properties-the-same-way-that-objects-can

Hmm..

thiell avatar Mar 03 '12 16:03 thiell