Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Subclass oftyping.Any cannot be instantiated with arguments #117110

Closed
Labels
@Azureblade3808

Description

@Azureblade3808

Bug report

Bug description:

fromtypingimportAnyclassC(Any):def__init__(self,v): ...C(0)# TypeError: object.__new__() takes exactly one argument (the type to instantiate)

The fix should be easy. Just replace --

returnsuper().__new__(cls,*args,**kwargs)

with --

returnsuper().__new__(cls)

intyping.Any.__new__(...), as the superclass isobject and its__new__ doesn't accept additional arguments.

CPython versions tested on:

3.12

Operating systems tested on:

Linux, Windows

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp