Alternate initializer pattern?

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top