Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typing.Protocol is better candidate for base serialization classes. #10

Closed
PradyumnaKrishna opened this issue Aug 16, 2022 · 2 comments
Closed

Comments

@PradyumnaKrishna
Copy link

Description of issue or feature request:
The following classes of serialization module would be better candidates for typing.Protocol than abc:

  • BaseSerializer
  • BaseDeserializer
  • JSONSerializable

typing.Protocol requires python version 3.8 and above and hence this couldn't be done now.
After dropping support of python 3.7 by securesystemslib these classes should use typing.Protocol.

Current Behaviour
Mentioned classes are abstract base class in serialization module.

Expected behavior:
Mentioned classes should be typing.Protocol.

Originally posted by @lukpueh in #9 (review)

@adityasaky
Copy link
Member

Can we track this in the upstream securesystemslib repository instead of here?

@lukpueh
Copy link
Member

lukpueh commented Jan 10, 2023

I think I am in favor of just closing this issue:

  • using Protocol does not improve user/developer experience significantly enough to justify using a backport for Python 3.7 now, or a refactor after dropping 3.7

  • @jku raised valid concerns about lack of declaration in classes that implement a Protocol

@lukpueh lukpueh closed this as completed Jan 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants