Skip to content
Discussion options

You must be logged in to vote

I think the best solution here would be to add a method called __call__ to your ClampedNumber class which should look like

	def __call__(self):
		...

This will allow https://github.com/python/cpython/blob/bc3961485639cc73de7c4c7eed1b56f3c74939bf/Lib/typing.py#L173 to pass successfully, and allow your converter to be used as expected.

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@jelni
Comment options

Answer selected by jelni
Comment options

You must be logged in to vote
1 reply
@jelni
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants