Skip to content

Commit e81dae1

Browse files
authored
Merge pull request #73 from ArcanaFramework/docs-warning
added warning about static type-checking to docs
2 parents e55ea31 + f38cf7c commit e81dae1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/source/typing.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ be classified as containing a PNG image
2626
>>> Zip[Jpeg].matches(zipped_png_fspath)
2727
False
2828
29+
.. note:: warning
30+
At the time of writing currently classifiers are not supported by Mypy and other
31+
static type checkers (only dynamic type-checking in Pydra_) because they use a
32+
custom `__subclasshook__` method to implement the subclassing behaviour and overload
33+
the `__class_getitem__` method, which isn't recommended in the official docs. It is
34+
hoped that it will be possible to implement a custom Mypy plugin in the future to
35+
support this feature.
36+
2937
The types of classes that can be used to classify varies from type to type. For archive
3038
types like :class:`.Zip`, :class:`.Gzip`, take another file format type, others specific
3139
classifier types. Some classifiable types can take multiple classifiers, whereas others can

0 commit comments

Comments
 (0)