Skip to content

mangling of double-underscore method argument names #1382

@robertwb

Description

@robertwb

CPython apparently does this:

class Spam:
    def eggs(__some_kwarg:int=None):
        print(__some_kwarg)

>>> Spam.eggs(10)
10
>>> Spam.eggs(_Spam__some_kwarg=10)
10

class Foo:
  def bar(self, *, __kw:'anno'='default'):
    pass

>>> Foo.bar.__annotations__
{'_Foo__kw': 'anno'}
>>> Foo.bar.__kwdefaults__
{'_Foo__kw': 'default'}

http://bugs.python.org/issue20625

Migrated from http://trac.cython.org/ticket/826

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions