Skip to content

Latest commit

 

History

History
47 lines (31 loc) · 1.23 KB

index.rst

File metadata and controls

47 lines (31 loc) · 1.23 KB

PPB's 2D Vector class

Note

ppb-vector follows the semver (semantic versioning) convention. In a nutshell, we commit to forward compatibility within a major version: code that works with version 1.0 ought to work with any 1.x release.

ppb_vector.Vector

x

The X coordinate of the vector

y

The Y coordinate of the vector

Pattern Matching

(Python 3.10 and up only. See pep636 (PEP 636) for information on pattern matching in general.)

:pyVector supports not only basic pattern matching (case Vector(x=4, y=2):), but also supports positional arguments (case Vector(4, 2):) and also comparison to sequences (case (4, 2):).

However, it does not support matching against dictionaries (case {'x': 4, 'y': 2}:).

Inheriting from :pyVector

:pyVector does not support inheritance.