def __init__(self, key, mass_fractions, atomic_fractions, formula):
        """
        Private constructor. It should never be used.
        """
        if key != Composition._key:
            raise TypeError('Composition cannot be created using constructor')
        if set(mass_fractions.keys()) != set(atomic_fractions.keys()):
            raise ValueError('Mass and atomic fractions must have the same elements')

        self.mass_fractions = MappingProxyType(mass_fractions)
        self.atomic_fractions = MappingProxyType(atomic_fractions)
        self._formula = formula
def __init__ ( self , key , mass_fractions , atomic_fractions , formula ) : if key != Composition . _key : raise TypeError ( 'Composition cannot be created using constructor' ) if set ( mass_fractions . keys ( ) ) != set ( atomic_fractions . keys ( ) ) : raise ValueError ( 'Mass and atomic fractions must have the same elements' ) self . mass_fractions = MappingProxyType ( mass_fractions ) self . atomic_fractions = MappingProxyType ( atomic_fractions ) self . _formula = formula
Private constructor. It should never be used.