Skip to content

Commit

Permalink
lib/python/types.* : Add type hints, docstrings,
Browse files Browse the repository at this point in the history
Summary:
The main motivation here is to improve overall code quality and maintainability, through documentation, typing and method naming.

The addition of type hints in Cython code also affects type safety, as previously unchecked calls will now be checked against the declared types (and raise `TypeError` on mismatch).

Reviewed By: yoney

Differential Revision: D57443704

fbshipit-source-id: 1f4f078041655261d21440bff0f68cea21c9dae6
  • Loading branch information
Aristidis Papaioannou authored and facebook-github-bot committed May 18, 2024
1 parent 21105e1 commit 014e766
Show file tree
Hide file tree
Showing 3 changed files with 184 additions and 66 deletions.
2 changes: 1 addition & 1 deletion third-party/thrift/src/thrift/lib/python/types.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ cdef class Union(StructOrUnion):
cdef readonly object value
cdef void _fbthrift_load_cache(self) except *
cdef object _fbthrift_to_internal_data(self, type_value, value)
cdef void _fbthrift_update_type_value(self, type_value, value) except *
cdef void _fbthrift_set_union_value(self, int field_id, object value) except *
cdef folly.iobuf.IOBuf _serialize(Union self, Protocol proto)
cdef uint32_t _deserialize(Union self, folly.iobuf.IOBuf buf, Protocol proto) except? 0

Expand Down

0 comments on commit 014e766

Please sign in to comment.