[cctbxbb] boost python and metaclass inheritance

Luc Bourhis luc_j_bourhis at mac.com
Wed Jan 8 16:43:44 PST 2014


> a boost python wrapper's __metaclass__ is its __class__, depending how it is constructed. I still couldn't work out from that how to proceed though, 

Yes, indeed, I forgot about that. So here is the solution then, but I still recommend to forget about it.

import abc
from scitbx.lstbx import normal_eqns
class Refinery(object):
  class __metaclass__(normal_eqns.non_linear_ls.__class__, abc.ABCMeta): pass

class AdaptLstbx(Refinery, normal_eqns.non_linear_ls): pass

Best wishes,

Luc





More information about the cctbxbb mailing list