8000 Optional on methods for no reason? · Issue #2660 · cloudflare/cloudflare-python · GitHub
[go: up one dir, main page]

Skip to content
Optional on methods for no reason? #2660
Closed as not planned
Closed as not planned
@Dreamsorcerer

Description

@Dreamsorcerer

Describe the bug

Methods such as .create() and .edit() are all annotated as returning Optional:

) -> Optional[CustomHostnameCreateResponse]:

Looking at the code though, it just ends up calling the httpx.get()/.patch() methods which will never return None.

This results in some weird user code, where we have to check for None to satisfy the type checker, but it will actually never return None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0