Skip to content

Rename .create(_type) to type #45

Closed

Description

@llucax

What's needed?

We need a clear interface. Using _type is not necessary and it is confusing, as usually in python stuff that starts with _ is not supposed to be set by users.

Proposed solution

Use type.

Additional context

Activity

  1. added
    scope:breaking-change
    type:enhancement
    on May 3, 2024
  2. added this to the v0.3.0 milestone on May 3, 2024
  3. Marenz commented on Jun 21, 2024

    @Marenz
    Contributor

    Well, here is the reason I didn't use type.

    nox > pylint src docs noxfile.py tests
    ************* Module frequenz.client.dispatch._client
    src/frequenz/client/dispatch/_client.py:124:8: W0622: Redefining built-in 'type' (redefined-builtin)
    
    -------------------------------------------------------------------
    Your code has been rated at 9.99/10 (previous run: 10.00/10, -0.01)
    
    nox > Command pylint src docs noxfile.py tests failed with exit code 4
    nox > Session pylint failed.
    
  4. llucax commented on Jun 21, 2024

    @llucax
    ContributorAuthor

    You can add a disable rule. In general I think it is good not to shadow built-ins, but in this case I think it makes sense to make an exception.

  5. added a commit that references this issue on Jun 24, 2024
    fe79a84
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    scope:breaking-changetype:enhancement

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions