[TransWarp] Proposed peak.binding API change
Ty Sarna
tsarna at sarna.org
Wed Sep 3 11:08:41 EDT 2003
I'm -1 on Provide/Require... too much implication of dependancy
ordering, module dependancies, etc for me, and too much of a "these come
in pairs" effect as well... makes me wonder if for each require in one
class, there should be a corresponding provide in another or something
like that.
I'm not sure if like it better than Attr (or the status quo, for that
matter), but one possible replacement name for Provide is Default, or
maybe defaultTo. Since after all, that's what they do, serve as
defaults unless you wire them up explicitly. Then, you just need to
change the "default" keyword parameter so it reads better
binding.Default(aFunction)
binding.Default(someType)
binding.Default("somemodule.sometype")
binding.Default(value=42)
binding.Default(lambda: expr)
Jean Jordan wrote:
> binding.Bind(...) would be totally neutral, and would work
> with binding.Require(...) ..
we talked about making it just "binding" (IOW, make the module
callable). But that introduces lots of ickyness in the process.
More information about the PEAK
mailing list