Skip to main content

Библиотека создана для отправки отклика на hh.ru

Project description

Библиотека создана для отправки отклика на hh.ru. Предоставляет возможность работы с классами геометрических фигур с соблюдением OCP(Open/Closed Principle) SOLID. Содержит всего лишь 3 класса. Два дефолтных: треугольник и круг и класс-фабрику, который используется для регистрации класса геометрической фигуры(при его объявлении) и для создания объектов класса. При создании своих фигур необходимо наследоваться от класса Figure.

Пример:

from figures_super_mega_project import FigureFactory, Figure
from typing import Union


@FigureFactory.register("square")
class Square(Figure):
    def __init__(self, side: Union[float, int]) -> None:
        self.side = side

    def calculate_area(self) -> float:
        return float(self.side**2)


figures = [('square', {'side': 5})]
for figure_name, figure_params in figures:
    figure = FigureFactory.create(figure_name, figure_params)
    print(f"{figure_name}: {figure.calculate_area()}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

figures_super_mega_project-0.0.2.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

figures_super_mega_project-0.0.2-py2.py3-none-any.whl (4.7 kB view details)

Uploaded Python 2Python 3

File details

Details for the file figures_super_mega_project-0.0.2.tar.gz.

File metadata

File hashes

Hashes for figures_super_mega_project-0.0.2.tar.gz
Algorithm Hash digest
SHA256 f13f50f275c3ebc57acdbe04851889074df3a5177e3b26bba1f1968bfda76efb
MD5 d028a3bbb1453528745e7dc44716c52c
BLAKE2b-256 45a5f2751ce65a1222e01ce89de2a25aa270021d554cd2249612886f32483f77

See more details on using hashes here.

File details

Details for the file figures_super_mega_project-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for figures_super_mega_project-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 c5a80c49b440fc1866963892585128110bdd5a1e25d2130b2102c100b0170eb6
MD5 665c66eedf45b06b8f16d86202819141
BLAKE2b-256 02d534c3c51a643a20cf844d0824188a18889723640e94c639f75a39d9cbeb80

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page