Conversation
captcha/image.py
Outdated
| return image | ||
|
|
||
| def create_captcha_image(self, chars, color, background): | ||
| def create_captcha_image(self, chars: str, color: tuple, background: tuple, rotate: bool = True): |
There was a problem hiding this comment.
this tuple type hint is not compatible with 3.8.
There was a problem hiding this comment.
I use Python 3.8 in almost all of my projects and this hint works fine. The project using this library with my modifications is no exception.
There was a problem hiding this comment.
It is working if not parametrized, but using tuple[...] is 3.9+.
(It is usually recommended to parametrize generic types, if you don't know the structure of the color argument, you can use typing.Tuple[T, ...])
There was a problem hiding this comment.
why dont yall just from __future__ import annotations
|
Okay, if you think there might be a problem with type hints, let's delete them. |
|
I think they could be added to the whole package, maybe? |
|
This is an advanced feature. I'd like to make image captcha the ability to add character by character, in this way, developers can control each character themselves. |
Once special characters are rotated, they become illegible. So I added the ability to disable rotation of all text characters and disable rotation of special characters anyway.