# Tip 42 prefer to use public attributes than the private ones

# example of a class with private instance variable
class PrivateObject:
    def __init__(self):
        self.__private_field = 10

    def get_private_field(self):
        return self.__private_field


# example of a class with protected instance variable
class ProtectedObject:
    def __init__(self, protected_field):
        self._protected_field = protected_field

    @property
    def protected_field(self):
        return self._protected_field

    @protected_field.setter
    def protected_field(self, protected_field):
        self._protected_field = protected_field


# example of a class with public instance variable
class PublicObject:
    def __init__(self):
        self.public_field = 5

    def get_public_field(self):
        return self.public_field

74773010a2f40c9e439f30011da860aed651d889
<mask token>


class ProtectedObject:

    def __init__(self, protected_field):
        self._protected_field = protected_field
    <mask token>
    <mask token>


class PublicObject:

    def __init__(self):
        self.public_field = 5

    def get_public_field(self):
        return self.public_field

<mask token>


class ProtectedObject:

    def __init__(self, protected_field):
        self._protected_field = protected_field

    @property
    def protected_field(self):
        return self._protected_field

    @protected_field.setter
    def protected_field(self, protected_field):
        self._protected_field = protected_field


class PublicObject:

    def __init__(self):
        self.public_field = 5

    def get_public_field(self):
        return self.public_field

class PrivateObject:
    <mask token>

    def get_private_field(self):
        return self.__private_field


class ProtectedObject:

    def __init__(self, protected_field):
        self._protected_field = protected_field

    @property
    def protected_field(self):
        return self._protected_field

    @protected_field.setter
    def protected_field(self, protected_field):
        self._protected_field = protected_field


class PublicObject:

    def __init__(self):
        self.public_field = 5

    def get_public_field(self):
        return self.public_field

class PrivateObject:

    def __init__(self):
        self.__private_field = 10

    def get_private_field(self):
        return self.__private_field


class ProtectedObject:

    def __init__(self, protected_field):
        self._protected_field = protected_field

    @property
    def protected_field(self):
        return self._protected_field

    @protected_field.setter
    def protected_field(self, protected_field):
        self._protected_field = protected_field


class PublicObject:

    def __init__(self):
        self.public_field = 5

    def get_public_field(self):
        return self.public_field

# Tip 42 prefer to use public attributes than the private ones

# example of a class with private instance variable
class PrivateObject:
    def __init__(self):
        self.__private_field = 10

    def get_private_field(self):
        return self.__private_field


# example of a class with protected instance variable
class ProtectedObject:
    def __init__(self, protected_field):
        self._protected_field = protected_field

    @property
    def protected_field(self):
        return self._protected_field

    @protected_field.setter
    def protected_field(self, protected_field):
        self._protected_field = protected_field


# example of a class with public instance variable
class PublicObject:
    def __init__(self):
        self.public_field = 5

    def get_public_field(self):
        return self.public_field
