File: classes.py

package info (click to toggle)
sphinx-automodapi 0.22.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,180 kB
  • sloc: python: 1,769; makefile: 196
file content (51 lines) | stat: -rw-r--r-- 711 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
__all__ = ['Spam', 'Egg']


class BaseSpam:
    """
    Base class for Spam
    """

    def eat(self, time):
        """
        Eat some spam in the required time.
        """
        pass

    def buy(self, price):
        """
        Buy some MOAR spam.
        """
        pass


class Spam(BaseSpam):
    """
    The main spam
    """
    pass


class Egg:
    """
    An egg (no inheritance)
    """

    def eat(self, time):
        """
        Eat some egg in the required time.
        """
        pass

    def buy(self, price):
        """
        Buy some MOAR egg.
        """
        pass

    @property
    def weight(self):
        """
        The weight of an egg
        """
        return 0