Fix various review comments.
- Missing import in _ffi/__init__.py - Updated docstring of t2b - Reverted change to Random.__del__()pull/100/head
parent
8448f41b42
commit
338a4839b9
|
|
@ -1,4 +1,5 @@
|
|||
import _cffi_backend
|
||||
import _ffi.lib as lib
|
||||
|
||||
ffi: _cffi_backend.FFI
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
|
||||
from _cffi_backend import FFI
|
||||
from typing_extensions import TypeAlias
|
||||
from typing import TypeAlias
|
||||
|
||||
INVALID_DEVID: int
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class Random:
|
|||
def __del__(self) -> None:
|
||||
if self.native_object:
|
||||
try:
|
||||
Random._delete(self.native_object)
|
||||
self._delete(self.native_object)
|
||||
except AttributeError:
|
||||
# Can occur during interpreter shutdown
|
||||
pass
|
||||
|
|
|
|||
|
|
@ -29,7 +29,8 @@ def t2b(string: bytes | bytearray | memoryview | str) -> bytes:
|
|||
"""
|
||||
Converts text to binary.
|
||||
|
||||
Passes through bytes, bytearray, and memoryview unchanged.
|
||||
Passes through bytes unchanged.
|
||||
Objects of type bytearray or memoryview are converted to bytes.
|
||||
Encodes str to UTF-8 bytes.
|
||||
"""
|
||||
if isinstance(string, (bytes, bytearray, memoryview)):
|
||||
|
|
|
|||
Loading…
Reference in New Issue