Type hinting for h5py File object?

Viewed 20

Is there a correct way to type hint h5py file object?

When I check:

f = h5py.File(path_to_hdf5_file, mode='r+')
type(f)
>>> h5py._hl.files.File

However, using:

def my_func(h5file: h5py._hl.files.File):
  pass

PyCharms Checker remarks: "Access to a protected member _hl of a class".

Is there any good way to circumvent this?

0 Answers
Related