Skip to content

Commit

Permalink
Simplify MappingProxyView mapping setter
Browse files Browse the repository at this point in the history
  • Loading branch information
ionite34 committed Jan 23, 2023
1 parent c14b2ab commit bfb7117
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/einspect/views/view_mapping_proxy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from __future__ import annotations

from ctypes import pointer
from types import MappingProxyType
from typing import TypeVar

Expand Down Expand Up @@ -47,4 +46,4 @@ def mapping(self) -> dict[_KT, _VT]:
@mapping.setter
@unsafe
def mapping(self, value: dict[_KT, _VT]) -> None:
self._pyobject.mapping = pointer(PyDictObject.from_object(value))
self._pyobject.mapping = PyDictObject.from_object(value).with_ref().as_ref()

0 comments on commit bfb7117

Please sign in to comment.