Re: ABC hackery

2013-12-12 Thread Chris Angelico
On Fri, Dec 13, 2013 at 6:26 AM, Demian Brecht wrote: > Not recommended for anything outside of POC :) I love that kind of code :) ChrisA -- https://mail.python.org/mailman/listinfo/python-list

ABC hackery

2013-12-12 Thread Demian Brecht
Hey all, Thought I'd share some fun I had some time ago when digging into abcs and metaclasses: https://gist.github.com/demianbrecht/6944269. The implementation piggy backs off of abcs to achieve "class A should look like class B" type functionality without using inheritance. Not recommended for

Re: Metaclass/abc hackery

2013-10-11 Thread Marco Buttu
On 10/12/2013 04:47 AM, Demian Brecht wrote: Working on this though brought up a question: Is there anything in the data model that acts like "__setattr__" but when operating on a class definition instead of an instance? I'd be able to get rid of the late_bind function if something like that's a

Metaclass/abc hackery

2013-10-11 Thread Demian Brecht
As with most I'm sure, short of using abc's, I've had very little exposure to metaclasses. So, when digging into abc implementation, I figured it would be a good idea to dig into metaclasses, their usage and actually try writing one. What I did may be contrived, but it was fun nonetheless and a go