markjoshwel / tomlantic

marrying pydantic models and tomlkit documents for data validated, style-preserving toml files
The Unlicense
1 stars 1 forks source link

0.2.1: docs for get and setter functions are incomplete #3

Closed markjoshwel closed 8 months ago

markjoshwel commented 8 months ago
def get_toml_field(
    document: TOMLDocument,
    location: Union[str, Tuple[str, ...]],
    default: Any = None,
) -> Any:
    """
    safely retrieve a toml documents field by it's location. not recommended for general
    use due to a lack of type information, but useful when accessing fields
    programatically

    arguments:
        - location: `str | tuple[str, ...]`
        - default: `Any` = `None`

    returns the field if it exists, otherwise `default`
    """

arguments list is missing document

markjoshwel commented 8 months ago

same for set_toml_field

markjoshwel commented 8 months ago

both apply also for the README.md

markjoshwel commented 8 months ago

hell, _get_model_field() too

vlshields commented 8 months ago

Hi @markjoshwel !

I'm new here. I just submitted a PR for this issue. I only updated the get_toml_field function for now. But if I did it right I will update the others you mentioned (separate branch for each of course).