From 6aef0172741d60f46817fcf38060913418baac71 Mon Sep 17 00:00:00 2001 From: Avasam Date: Fri, 16 Aug 2024 23:41:47 -0400 Subject: [PATCH] Fix FilesSpec parameters variance issues by making it a Mapping instead of a dict --- jaraco/path.py | 5 +++-- newsfragments/xxxx.bugfix.rst | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 newsfragments/xxxx.bugfix.rst diff --git a/jaraco/path.py b/jaraco/path.py index 19155ee..d0eb980 100644 --- a/jaraco/path.py +++ b/jaraco/path.py @@ -2,6 +2,7 @@ Tools for working with files and file systems """ +from collections.abc import Mapping import os import re import itertools @@ -16,7 +17,7 @@ import ctypes import importlib import pathlib -from typing import Dict, Protocol, Union +from typing import Protocol, Union from typing import runtime_checkable @@ -285,7 +286,7 @@ class Symlink(str): """ -FilesSpec = Dict[str, Union[str, bytes, Symlink, 'FilesSpec']] # type: ignore +FilesSpec = Mapping[str, Union[str, bytes, Symlink, 'FilesSpec']] # type: ignore @runtime_checkable diff --git a/newsfragments/xxxx.bugfix.rst b/newsfragments/xxxx.bugfix.rst new file mode 100644 index 0000000..754a8cb --- /dev/null +++ b/newsfragments/xxxx.bugfix.rst @@ -0,0 +1 @@ +Fix ``FilesSpec`` parameters variance issues by making it a `collections.abc.Mapping` instead of a `dict` -- by :user:`Avasam`