private class names variables should be preceded by _
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Accomplishments Daemon |
Fix Released
|
Low
|
Matt Fischer |
Bug Description
In python you can do a dir() on an object and use the results to write code even if you lack documentation. The pythonic way of marking something as private is to use _ in the name, for example _variable or _function_name. In the daemon, this was done for functions, perhaps not all of them, but not at all for variables. The _ in the name does not prevent someone from accessing the variable, just tells them "hey, you should be using a public interface, this one is not public". One example of a private variable is the script_queue variable in the Accomplishments class. Nobody should be messing with this except the class itself.
In the interest of keeping private variables private, I'd recommend the following changes:
1) Verify that all non-API functions are preceded by _.
2) Rename all private variables with an _ in the name.
Reference:
http://
Changed in ubuntu-accomplishments-daemon: | |
status: | New → Confirmed |
importance: | Undecided → Low |
milestone: | none → 0.3 |
tags: | added: bitesize |
Changed in ubuntu-accomplishments-daemon: | |
assignee: | nobody → Matt Fischer (mfisch) |
Changed in ubuntu-accomplishments-daemon: | |
status: | Fix Committed → Fix Released |
Jono and I decided to only fix the functions, and there was only one incorrect. I fixed it and added some comments about places that need unit tests and fixed the typo in the spelling of list_opportunit ies()