Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make_dataclass is missing the documented kw_only argument #89961

Closed
kintisheff mannequin opened this issue Nov 13, 2021 · 3 comments
Closed

make_dataclass is missing the documented kw_only argument #89961

kintisheff mannequin opened this issue Nov 13, 2021 · 3 comments
Assignees
Labels
3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@kintisheff
Copy link
Mannequin

kintisheff mannequin commented Nov 13, 2021

BPO 45803
Nosy @ericvsmith, @miss-islington, @kintisheff
PRs
  • bpo-45803: Added kw_only parameter to make_dataclasses. #29679
  • [3.10] bpo-45803: Added kw_only parameter to make_dataclasses. (GH-29679) #29680
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ericvsmith'
    closed_at = <Date 2021-11-20.23:28:28.451>
    created_at = <Date 2021-11-13.19:57:16.906>
    labels = ['type-bug', 'library', '3.10', '3.11']
    title = 'make_dataclass is missing the documented kw_only argument'
    updated_at = <Date 2021-11-20.23:29:19.361>
    user = 'https://github.com/kintisheff'

    bugs.python.org fields:

    activity = <Date 2021-11-20.23:29:19.361>
    actor = 'miss-islington'
    assignee = 'eric.smith'
    closed = True
    closed_date = <Date 2021-11-20.23:28:28.451>
    closer = 'eric.smith'
    components = ['Library (Lib)']
    creation = <Date 2021-11-13.19:57:16.906>
    creator = 'kintisheff'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45803
    keywords = ['patch']
    message_count = 3.0
    messages = ['406290', '406291', '406694']
    nosy_count = 3.0
    nosy_names = ['eric.smith', 'miss-islington', 'kintisheff']
    pr_nums = ['29679', '29680']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue45803'
    versions = ['Python 3.10', 'Python 3.11']

    @kintisheff
    Copy link
    Mannequin Author

    kintisheff mannequin commented Nov 13, 2021

    According to the 3.10 documentation, make_dataclass includes the kw_only argument:

    def make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True,

    However, the source code referred to by the same doc does not appear to include the kw_only argument:

    def make_dataclass(cls_name, fields, *, bases=(), namespace=None, init=True,

    @kintisheff kintisheff mannequin added topic-ctypes 3.10 only security fixes labels Nov 13, 2021
    @kintisheff
    Copy link
    Mannequin Author

    kintisheff mannequin commented Nov 13, 2021

    to clarify, the documentation permalink is: https://docs.python.org/3/library/dataclasses.html#dataclasses.make_dataclass

    @ericvsmith ericvsmith added stdlib Python modules in the Lib dir 3.11 only security fixes and removed topic-ctypes labels Nov 13, 2021
    @ericvsmith ericvsmith self-assigned this Nov 13, 2021
    @ericvsmith ericvsmith added stdlib Python modules in the Lib dir 3.11 only security fixes and removed topic-ctypes labels Nov 13, 2021
    @ericvsmith ericvsmith self-assigned this Nov 13, 2021
    @ericvsmith ericvsmith added type-bug An unexpected behavior, bug, or error labels Nov 20, 2021
    @ericvsmith
    Copy link
    Member

    Thanks for the bug report!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    jkimbo added a commit to strawberry-graphql/strawberry that referenced this issue Nov 3, 2022
    Python 3.10.0 missed the `kw_only` parameter for
    `dataclasses.make_dataclass()`: python/cpython#89961
    It was added in 3.10.1.
    
    This change updates the version checking in the Pydantic integration to
    only use the `kw_only` parameter for 3.10.1 versions and above.
    Otherwise to falls back to our custom init function.
    
    Diff-Id: 5faf9
    jkimbo added a commit to strawberry-graphql/strawberry that referenced this issue Nov 3, 2022
    Python 3.10.0 missed the `kw_only` parameter for
    `dataclasses.make_dataclass()`: python/cpython#89961
    It was added in 3.10.1.
    
    This change updates the version checking in the Pydantic integration to
    only use the `kw_only` parameter for 3.10.1 versions and above.
    Otherwise to falls back to our custom init function.
    
    Diff-Id: 5faf9
    patrick91 pushed a commit to strawberry-graphql/strawberry that referenced this issue Nov 4, 2022
    * Fix dataclass creation in Pydantic integration for Python 3.10.0
    
    Python 3.10.0 missed the `kw_only` parameter for
    `dataclasses.make_dataclass()`: python/cpython#89961
    It was added in 3.10.1.
    
    This change updates the version checking in the Pydantic integration to
    only use the `kw_only` parameter for 3.10.1 versions and above.
    Otherwise to falls back to our custom init function.
    
    Diff-Id: 5faf9
    
    * Add RELEASE file
    
    Diff-Id: 5a2cc
    
    * Fix line too long error
    
    Diff-Id: 4d6e7
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant