Improve __enter__ typing for things
This commit is contained in:
parent
d52548cc13
commit
afbc00acef
6 changed files with 19 additions and 20 deletions
|
|
@ -15,7 +15,7 @@ import tempfile
|
|||
import time
|
||||
from datetime import datetime
|
||||
from types import TracebackType
|
||||
from typing import Any, Literal, Mapping, Optional, Tuple
|
||||
from typing import Any, Literal, Mapping, Optional, Self, Tuple
|
||||
|
||||
import numpy as np
|
||||
import piexif
|
||||
|
|
@ -180,7 +180,7 @@ class BaseCamera(lt.Thing):
|
|||
}
|
||||
self._detector_name = "Channel Deviations (LUV)"
|
||||
|
||||
def __enter__(self) -> None:
|
||||
def __enter__(self) -> Self:
|
||||
"""Open hardware connection when the Thing context manager is opened."""
|
||||
raise NotImplementedError("CameraThings must define their own __enter__ method")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue