Skip to content

[stubtest] Type re-export creates duplicated error with invalid line number #15023

Open
@sobolevn

Description

@sobolevn

In this issue we can clearly see a problem: python/typeshed#10022

Error message:

 error: bs4.Tag.decode is inconsistent, stub does not have argument "iterator"
Stub: in file /home/runner/work/typeshed/typeshed/stubs/beautifulsoup4/bs4/__init__.pyi:301
def (self: bs4.element.Tag, indent_level: Union[builtins.int, None] =, eventual_encoding: builtins.str =, formatter: Union[builtins.str, bs4.formatter.Formatter] =) -> builtins.str
Runtime: in file /tmp/tmpn18q88e9/lib/python3.10/site-packages/bs4/element.py:1689
def (self, indent_level=None, eventual_encoding='utf-8', formatter='minimal', iterator=None)

error: bs4.element.Tag.decode is inconsistent, stub does not have argument "iterator"
Stub: in file /home/runner/work/typeshed/typeshed/stubs/beautifulsoup4/bs4/element.pyi:301
def (self: bs4.element.Tag, indent_level: Union[builtins.int, None] =, eventual_encoding: builtins.str =, formatter: Union[builtins.str, bs4.formatter.Formatter] =) -> builtins.str
Runtime: in file /tmp/tmpn18q88e9/lib/python3.10/site-packages/bs4/element.py:1689
def (self, indent_level=None, eventual_encoding='utf-8', formatter='minimal', iterator=None)

Why is it problematic?

  1. It is a duplicate (I think we can live with it, because change it is not trivial)
  2. Notice that __init__.py error has the same line number as the original, ideally it should have this line number: https://github.com/python/typeshed/blob/cc674b5dcef0c14612e79be255d0b2a8b0e11f81/stubs/beautifulsoup4/bs4/__init__.pyi#L19

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions