|Issue 678:||Enable exposing only some of the functions in a module as keywords with Python's `__all__` attribute|
|Back to list|
Currently all functions/methods not starting with an underscore exposed as keywords when a module is used as a library. This can cause problems such as in issue 677 . Prefixing all the helpers with an underscore isn't a very nice general solution because you can easily forget to do that. In my opinion the easiest solution for this problem is making it possible to list what functions actually are keywords. If you use this feature, no helper can ever be accidentally exposed as a keyword. A drawback is that you need to remember list also all new keywords, but forgetting that is easy to spot because the new keywords won't work otherwise. By default all functions would be keywords just as it's done now. We could use some special `ROBOT_XXX` attribute for this purpose, but Python already has `__all__` which we even use with variable files. Honoring `__all__` also when creating keywords is, in my opinion, logical and also nicely solves the underlying problem.
Oct 26, 2010
(No comment was entered for this change.)
Oct 27, 2010
Implementation, tests, and documentation in r4272.
|► Sign in to add a comment|