Fix type annotations#802
Conversation
kwzrd
left a comment
There was a problem hiding this comment.
Looks good, I think I only caught 1 or 2 things that could mistakes, but you be the judge of that.
I approach this as a PR that intends to make better use of PEP 585. Therefore I was mostly looking for regression; I haven't verified that all existing hints are correct.
kwzrd
left a comment
There was a problem hiding this comment.
Looks LGTM to me, good changes overall.
The notion of imposing better validation on data coming from external sources is attractive, though on the other hand Lancebot is primarily aimed at beginners. I don't know whether it'd make sense to put in the effort of making existing features more resilient if the same level of resilience isn't required from new contributions.
|
I think it's a good idea to teach beginners about validation, security and all that stuff. Lancebot being a learning project, we want to teach people good practices. Besides, the bot is running on our hardware and has access to some of our secrets, so we wouldn't want to introduce vulnerabilities (#801) |
|
I will be continuing this PR, as @decorator-factory authorized. |
ventaquil
left a comment
There was a problem hiding this comment.
Can some explain why sometimes it's import typing, sometimes it's from typing import ... and even sometimes it's import typing as t? 🤔
brad90four
left a comment
There was a problem hiding this comment.
LGTM. That was a lot of different files to go through!
|
I'll be getting this done soon, currently having IRL stuff. |
|
I intend to start working on this within the next 24 hours. |
|
I will be squashing this PR when it's done. |
MarkKoz
left a comment
There was a problem hiding this comment.
bot/exts/__init__.pyshould importIteratorfromcollections.abcinstead.bot/utils/extensions.pyshould importIteratorfromcollections.abcinstead.
55ecb2a to
745cd1d
Compare
MrHemlock
left a comment
There was a problem hiding this comment.
Everything looks solid. I didn't see anything missed.
fisher60
left a comment
There was a problem hiding this comment.
looks pretty good to me I think
|
I didn't squash, sorry about that. |
This PR aims to improve type annotations (type hints) in the project:
typing.List[int]) to new-style annotations (likelist[int])