Skip to content

Commit

Permalink
2.28.1
Browse files Browse the repository at this point in the history
  • Loading branch information
loyada committed Aug 16, 2024
1 parent fea04ae commit b18a3ec
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
18 changes: 18 additions & 0 deletions docs/structures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,24 @@ Just like Partial, Omit can also be used directly:
Bar = Omit[Foo, ("a", "b"), "Bar"]
Note that if the original class (Foo in the example above) has additional custom methods, Omit will not copy them.
The reason is that it can easily introduce errors. Consider:

.. code-block:: python
class Foo(Structure):
a: int
b: int
def getSum(self):
return self.a + self.b
class Bar(Omit[Foo, ["b"]]):
pass
# Error!
Bar(a=4).getSum()
Pick
----
(from v2.7.2)
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@
license="MIT",
long_description=long_description,
url="http://github.com/loyada/typedpy",
download_url="https://github.com/loyada/typedpy/archive/v2.28.0.tar.gz",
download_url="https://github.com/loyada/typedpy/archive/v2.28.1.tar.gz",
keywords=["testing", "type-safe", "strict", "schema", "validation"],
version="2.28.0",
version="2.28.1",
)

# coverage run --source=typedpy/ setup.py test
Expand Down

0 comments on commit b18a3ec

Please sign in to comment.