numpy / numpy-stubs

Experimental typing stubs for NumPy
BSD 3-Clause "New" or "Revised" License
282 stars 32 forks source link

ENH: add numerical constants #51

Closed person142 closed 4 years ago

person142 commented 4 years ago

Scraped them with this script:

import numpy as np

def main():
    constants = []
    for obj_name in dir(np):
        obj = getattr(np, obj_name)
        if isinstance(obj, float):
            constants.append(f'{obj_name}: float')
    print('\n'.join(sorted(constants)))

if __name__ == '__main__':
    main()
rgommers commented 4 years ago

LGTM, merged. Thanks @person142.

Note that there's also non-float constants; integer flags like np.CLIP.