Completed
Push — master ( 2bc047...202252 )
by Rich
01:16
created

ChemicalObject.from_super()   A

Complexity

Conditions 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 7
rs 9.4285
1
#! /usr/bin/env python
2
#
3
# Copyright (C) 2007-2009 Rich Lewis <[email protected]>
4
# License: 3-clause BSD
5
6
"""
7
skchem.core.base
8
9
Define base classes for scikit chem objects
10
"""
11
12
class ChemicalObject(object):
13
14
    """ A mixin for each chemical object in scikit-chem """
15
16
    @classmethod
17
    def from_super(cls, obj):
18
19
        """A method that converts the class of an object of parent class to that of the child. """
20
21
        obj.__class__ = cls
22
        return obj
23