Get a field from the object for backward compatibility with before 8.12 see https://github.com/h5py/h5py/issues/2253
(self, field)
| 73 | obj: Any |
| 74 | |
| 75 | def get(self, field): |
| 76 | """Get a field from the object for backward compatibility with before 8.12 |
| 77 | |
| 78 | see https://github.com/h5py/h5py/issues/2253 |
| 79 | """ |
| 80 | # We need to deprecate this at some point, but the warning will show in completion. |
| 81 | # Let's comment this for now and uncomment end of 2023 ish |
| 82 | # Jan 2025: decomenting for IPython 9.0 |
| 83 | warnings.warn( |
| 84 | f"OInfo dataclass with fields access since IPython 8.12 please use OInfo.{field} instead." |
| 85 | "OInfo used to be a dict but a dataclass provide static fields verification with mypy." |
| 86 | "This warning and backward compatibility `get()` method were added in 8.13.", |
| 87 | DeprecationWarning, |
| 88 | stacklevel=2, |
| 89 | ) |
| 90 | return getattr(self, field) |
| 91 | |
| 92 | |
| 93 | def pylight(code): |