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

ChemicalObject   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %
Metric Value
dl 0
loc 11
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A from_super() 0 7 1
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