为pydicom扩展类型提示
项目描述
types-pydicom
扩展pydicom的Dataset元素关键词的类型提示。
安装
$ pip install types-pydicom
用法
# test_typing.py
from pydicom import Dataset
ds = Dataset()
ds.SamplesPerPixel = "abc"
reveal_type(ds.PixelData)
$ pip install pydicom types-pydicom mypy
$ mypy test_typing.py
test_typing.py:5: error: Incompatible types in assignment (expression has type "str", variable has type "int") [assignment]
test_typing.py:6: note: Revealed type is "Union[None, builtins.bytes]"
Found 1 errors in 1 file (checked 1 source file)
开发
git clone https://github.com/pydicom
git clone https://github.com/pydicom/types-pydicom
cd types-pydicom
mkdir env
python3.10 -m venv env/env310
source env/env310/bin/activate
pip install -e .[dev]
更新
python scripts/update_package.py
项目详情
下载文件
下载适合您平台的应用程序。如果您不确定选择哪个,请了解更多关于安装包的信息。
源分布
types_pydicom-3.0.0.0.tar.gz (105.0 kB 查看哈希值)
构建版本
types_pydicom-3.0.0.0-py3-none-any.whl (78.6 kB 查看哈希值)