It's so that internal details (that ctx defaults to desktopcouch.local_files.DEFAULT_CONTEXT) don't leak into subclasses, other functions/classes using it. It's also best-practice in the Python standard library... optional/keyword args default to simple, predictable values, most often None, sometime True/False, etc.
For example, in dmedia I need to provide a custom context when testing (Chad help me with this so I can test the same way desktopcouch itself does), but I don't want to deal with the desktopcouch.local_files.DEFAULT_CONTEXT detail myself.
It's so that internal details (that ctx defaults to desktopcouch. local_files. DEFAULT_ CONTEXT) don't leak into subclasses, other functions/classes using it. It's also best-practice in the Python standard library... optional/keyword args default to simple, predictable values, most often None, sometime True/False, etc.
For example, in dmedia I need to provide a custom context when testing (Chad help me with this so I can test the same way desktopcouch itself does), but I don't want to deal with the desktopcouch. local_files. DEFAULT_ CONTEXT detail myself.
See the dmedia MetaStore. __init_ _() on line 109: http:// bazaar. launchpad. net/~jderose/ dmedia/ trunk/annotate/ head%3A/ dmedialib/ metastore. py?start_ revid=104