JelleZijlstra / stubdefaulter

Add default values to stubs
Other
10 stars 4 forks source link

Blacklist a few functions with strange signatures at runtime on py37 #57

Closed AlexWaygood closed 1 year ago

AlexWaygood commented 1 year ago

Stubdefaulter always wants to add defaults to these signatures when I run it on the stdlib stubs using Python 3.7, but the defaults it wants to add look wrong. The cmath one is definitely wrong:

Python 3.7.16 (default, Jan 17 2023, 16:06:28) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cmath
>>> help(cmath.log)
Help on built-in function log in module cmath:

log(x, y_obj=None, /)
    The logarithm of z to the given base.

    If the base not specified, returns the natural logarithm (base e) of z.

>>> cmath.log(5, None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: must be real number, not NoneType

I haven't verified the other two in the same way, but they don't look correct either.

github-actions[bot] commented 1 year ago

This change has no effect on how stubdefaulter would alter typeshed's stdlib. 🤖🎉