Должен ли я документировать все параметры, исключения и возвращаемые значения функции, даже если они уже задокументироваPython

Программы на Python
Ответить Пред. темаСлед. тема
Anonymous
 Должен ли я документировать все параметры, исключения и возвращаемые значения функции, даже если они уже задокументирова

Сообщение Anonymous »

Я заметил, что во многих функциях повторяются одни и те же параметры. Пример:

Код: Выделить всё

def run_inspection(first_panel, last_panel, results, settings, references,
registration_settings):
"""
Runs multithreading for inspection stage.

Args:
first_panel (int): Number of the first panel to be inspected.
last_panel (int): Number of the last panel to be inspected.
results (data_management.StaticVar): Contains the results string.
settings (dictionary): General settings dictionary.
references (list): Contains dictionaries of references data.
registration_settings (dictionary): Contains data about the registration process.

Raises:
excepts.FatalError("WRONG_UV_INSPECTION_FLAG"): If the parameter
to define if UV light will be used has an incorrect value.

Returns:
total_time (float): Time it took to create results.
"""
и

Код: Выделить всё

def run_debug(first_panel, last_panel, results, settings, references):
"""
Runs multithreading for debug stage.

Args:
first_panel (int): Number of the first panel to be inspected.
last_panel (int): Number of the last panel to be inspected.
results (data_management.StaticVar): Contains the results string.
settings (dictionary): General configuration dictionary.
references (list): Contains dictionaries of references data.

Raises:
excepts.FatalError("WRONG_UV_INSPECTION_FLAG"): If the parameter
to define if UV light will be used has an incorrect value.

Returns:
total_time (float): Time it took to create results.
"""
Эти параметры постоянно повторяются во многих функциях (более шести).
Некоторые функции, использующие эти параметры, не связаны друг с другом.
Должен ли я документировать все параметры, исключения и возвращаемые значения функции, даже если они уже задокументированы во многих других функциях?

Подробнее здесь: https://stackoverflow.com/questions/654 ... a-function
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «Python»