B
buchanae
Hello.
I've been pondering an alternate initializer pattern that I've attempted to document here:
https://gist.github.com/abuchanan/7882317
Instead of using classmethod, I invent a new descriptor "alt_init" that creates an instance and passes it to the decorated function as the first argument (where classmethod would pass the class object).
I haven't used it in TheRealWord(tm), and maybe it's just a crappy Factory pattern (or is it Builder? or maybe Argile?), and I'm sure it has downsides, but I wanted to share anyway, to see what kind of feedback it would produce.
Thanks!
I've been pondering an alternate initializer pattern that I've attempted to document here:
https://gist.github.com/abuchanan/7882317
Instead of using classmethod, I invent a new descriptor "alt_init" that creates an instance and passes it to the decorated function as the first argument (where classmethod would pass the class object).
I haven't used it in TheRealWord(tm), and maybe it's just a crappy Factory pattern (or is it Builder? or maybe Argile?), and I'm sure it has downsides, but I wanted to share anyway, to see what kind of feedback it would produce.
Thanks!