Repository navigation
Add annotations to xml - #5542
Conversation
|
Updated annotation for While trying some things, I found that While the current |
|
Let's not make this complicated with Protocols. We are adding typing mainly for documentation purposes and partly to help Robot editord, the idea isn't, at least now, to do type checking. Complex types also don't help with the documentation goal, they just look confusing for non-technical users. I want to get RF 7.4 out soon. To keep this simple and to avoid wasting time, there are only two ways I see
If you want, you can experiment with Protocols and other ways to make typing better after the option 1. above is ready. If that brings concrete benefits, doesn't complicated code and doesn't make Libdoc documentation complicated, I can consider including it. I anyway want to be extremely clear that most likely such a PR will not be merged at least in RF 7.4 timeframe. My proposal how to move forward:
|
|
Ok, let's do that. I do believe that at least exploring Protocol with
the @runtime_checkable is worth some of our time since I think that if we
can support that, it'll be useful for library authors.
I'll see if I can update the PR tomorrow but I have a busy weekend ahead so
computer time may be very limited.
…On Thu, Nov 13, 2025 at 5:28 PM Pekka Klärck ***@***.***> wrote:
*pekkaklarck* left a comment (robotframework/robotframework#5542)
<#5542 (comment)>
Let's not make this complicated with Protocols. We are adding typing
mainly for documentation purposes and partly to help Robot editord, the
idea isn't, at least now, to do type checking. Complex types also don't
help with the documentation goal, they just look confusing for
non-technical users.
I want to get RF 7.4 out soon. To keep this simple and to avoid wasting
time, there are only two ways I see source can be annottated:
1. As Any. This is also the way I believe it should be annottated in
the beginning to get all the other annotations in.
2. As a custom Source class with a custom converter having
documentation that explains supported values. This would be good
considering the main goal is enhancing documentation. Type checkers may not
like it, but type checking isn't the goal so that's not a big problem.
If you want, you can experiment with Protocols and other ways to make
typing better after the option 1. above is ready. If that brings concrete
benefits, doesn't complicated code and doesn't make Libdoc documentation
complicated, I can consider including it. I anyway want to extremely clear
that most likely such a PR will not be merged at least in RF 7.4 timeframe.
My proposal how to move forward:
1. You create a PR with source: Any (or with source: Source where
Source is a type alias Source = Any).
2. I merge that PR.
3. You continue experimenting with better typing if you have interest
and don't mind if such enhancement may not be accepted.
4. I test how using a custom class with custom docs looks like.
5. I make a decision between Any, custom class and your possible PR
with enhanced typing.
—
Reply to this email directly, view it on GitHub
<#5542 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AK3CMZJWVRBG6OIOR67A6FT34SWUJAVCNFSM6AAAAACLZCFSB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKMRYGYZTENJQGI>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
|
Subclassing This means mypy / pylance don't report anything meaningful, but I believe this is the most useful / clear for the users of the library / keyword docs. |
pekkaklarck
left a comment
There was a problem hiding this comment.
Most important changes to be done:
- Use
Anyas the source in this initial PR. - Change
str | bytesto juststr.
|
Quick summary of the latest review:
|
closes #5541