insert_before() signatures cause PyCharm 'unexpected argument' warning
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Beautiful Soup |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
From my code, I call insert_before with two arguments like this:
insert_
PyCharm Professional 2020.2 gives me an 'Unexpected Argument' warning. I had to add a # noqa to the line to mask the problem. My code works correctly when I run it. I'm using BeautifulSoup 4.9.1.
The signature of insert_before in element.py is:
def insert_before(self, *args):
The signature in __init__.py is:
def insert_before(self, successor):
PyCharm must be checking my code against the signature in __init__.py. If I (temporarily) change the signature in __init__.py to match that in element.py, the PyCharm warning goes away.
Can you please review all the signatures in __init__.py that are overridden elsewhere and make them consistent with their implementations?
Thanks!
Changed in beautifulsoup: | |
status: | Fix Committed → Fix Released |
Revision 586 makes the signatures of BeautifulSoup. insert_ before and BeautifulSoup. insert_ after match TagElement. insert_ before and TagElement. insert_ after.