Skip to content

mypy stub for ConfigObj  #184

@Vykstorm

Description

@Vykstorm

Hello. I just wanted to suggest adding a 'stub' for this library for static typing using the library mypy (no need to change code, the stub can go in a separate file).
I have my own version here (incomplete)

For example, here is part of the code related to ConfigObj constructor

from typing import *

infile_type = Union[str, Union[List[str], Tuple[str]], IO[str], Dict[str, Any]]
outfile_type = Union[str, IO[str]]

class ConfigObj(Section):
    def __init__(
        self: Any,
        infile: Optional[infile_type] = None,
        raise_errors: bool = False, list_values: bool = True, create_empty: bool = False,
        file_error: bool = False, interpolation: bool = True, stringify: bool = True,
        configspec: Optional[infile_type] = None,
        indent_type: Optional[str] = None,
        encoding: Optional[str] = None, default_encoding: Optional[str] = None,
        unrepr: bool = False, write_empty_values: bool = False, _inspec: bool = False
        ): ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions