We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8fe62a9 commit 7c8ae9bCopy full SHA for 7c8ae9b
docs/index.rst
@@ -24,6 +24,23 @@ PPB's 2D Vector class
24
The Y coordinate of the vector
25
26
27
+Pattern Matching
28
+----------------
29
+
30
+(Python 3.10 and up only. See pep636_ (PEP 636) for information on pattern
31
+matching in general.)
32
33
+:py:class:`Vector` supports not only basic pattern matching
34
+(``case Vector(x=4, y=2):``), but also supports positional arguments
35
+(``case Vector(4, 2):``) and also comparison to sequences
36
+(``case (4, 2):``).
37
38
+However, it does not support matching against dictionaries
39
+(``case {'x': 4, 'y': 2}:``).
40
41
+.. _pep636: https://www.python.org/dev/peps/pep-0636/
42
43
44
Inheriting from :py:class:`Vector`
45
-----------------------------------
46
0 commit comments