
class Circle:
    PI = 3.14

    def __new__(cls, radius):
        cls.get_area = lambda self: self._radius**2 * self.PI
        cls.get_perimeter = lambda self: self.PI * self._diameter
        cls.get_radius = lambda self: self._radius
        cls.get_diameter = lambda self: self._diameter
        instance = super().__new__(cls)
        instance._radius = radius
        instance._diameter = 2 * radius
        return instance


def test_1():
    circle_instance = Circle(3.5)
    print(f"Radius: {circle_instance.get_radius()}")
    print(f"Diameter: {circle_instance.get_diameter()}")
    print(f"Area: {circle_instance.get_area()}")
    print(f"Perimeter: {circle_instance.get_perimeter()}")
    

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

class BaseConfig:
    def __new__(cls, *args, **kwargs):
        instance = super(BaseConfig, cls).__new__(cls)
        instance.debug = False
        instance.log_level = "INFO"
        return instance

class EmailConfig(BaseConfig):
    def __new__(cls, *args, **kwargs):
        instance = super().__new__(cls)
        instance.smtp_server = 'smtp.gmail.com'
        instance.smtp_port = 587
        instance.username = 'boss_of_gym@gmail.com'
        instance.password = ''
        return instance

class DatabaseConfig(BaseConfig):
    def __new__(cls, *args, **kwargs):
        instance = super().__new__(cls)
        instance.db_host = '127.0.0.1'
        instance.db_port = 5432
        instance.db_name = 'cookies'
        instance.db_user = 'admin'
        instance.db_password = 'admin'
        return instance

def test_2():
    email_config = EmailConfig()

    print("SMTP server Configuration:")
    print(f"Server: {email_config.smtp_server}")
    print(f"Port: {email_config.smtp_port}")
    print(f"User: {email_config.username}")
    print(f"Password: {email_config.password}")
    print(f"Debug: {email_config.debug}")
    print(f"Logger: {email_config.log_level}")


def main():
    # test_1()
    test_2()


if __name__ == '__main__':
    main()