You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
by reading through our discussions above, I see the the following tasks:
Remove check within function that test differnt type (than in param, andthen raise) + there tests[x] remove @keyword(types=None) since types provided* [ ] backwards compatibility (potentially > 30 functions)
provide param str | bytes args where possible (i have to check for each parameter, if the functions in the keyword can also be called on a buytes objects - no quick job)* add tests too (i hope this will not take forever, will only include basics)* (no code changes to add bytes support (stay with str))[x] Literal support (see DateTime)[ ] Adding a note like "Some keywords also work with bytes in addition to strings."
@pekkaklarck) I have implemented the tasks as far as I can. Problems remain with bytes support. Where I couldn't make a decision myself, I added a TODO(@pekkaklarck) to the functions with information.
The problem concerns backwards compatibility for keywords. Either
[1] You allow bytes—then a test function must truly support it (which is particularly difficult when there are 2-3 parameters that can each be either bytes or str influencing each other during code paths; in many cases that's simply not possible -> high risk for bugs).
[2] You don't allow bytes, because you can't support all parameter combinations—however, this would break older Robot versions if a user happened to use the one parameter combination that used to work (other type combinations would also then not work).
[3] Where bytes can't be safely introduced 100%, we can leave it as str, and there will be a few special cases where backwards compatibility cannot be maintained.
Could you perhaps adjust the remaining places according to your preferences in the MR?
Otherwise, I think the discussions will drag on for a long time back and forth, even though the implementation is already 95% finished.
local latests and utests PASS but there is some empty error porblem in the pipeline:
I added str | bytes were there should be no side effects (and added some tests).
I did not add str | bytes where different parameters could have different types (e.g. string as str and exclude as bytes, and so on) -> left a comment at those functions with TODO(...pekkaklarck) if you want to discuss. They are of course removed when MR is ready.
I don't have time to review this now, but after XML finally being ready, this one is next in my agenda.
One thing I wanted to note is that String has some keywords that are affected by #5558#5537. There's no need to deprecate anything as part of this issue, but it is likely that the affected keywords need to have Literal[""] as one accepted value for the start index. There ought to be tests for validating that the empty string is currently accepted and they ought to fail without that typing.
I don't have time to review this now, but after XML finally being ready, this one is next in my agenda.
One thing I wanted to note is that String has some keywords that are affected by #5558. There's no need to deprecate anything as part of this issue, but it is likely that the affected keywords need to have Literal[""] as one accepted value for the start index. There ought to be tests for validating that the empty string is currently accepted and they ought to fail without that typing.
Activity
silentw0lf commentedon Nov 23, 2025
Just copied notes from the main issue:
rebased upstream/master and pushed commits: #5554
@pekkaklarck) I have implemented the tasks as far as I can. Problems remain with bytes support. Where I couldn't make a decision myself, I added a TODO(@pekkaklarck) to the functions with information.
The problem concerns backwards compatibility for keywords. Either
[1] You allow
bytes—then a test function must truly support it (which is particularly difficult when there are 2-3 parameters that can each be eitherbytesorstrinfluencing each other during code paths; in many cases that's simply not possible -> high risk for bugs).[2] You don't allow
bytes, because you can't support all parameter combinations—however, this would break older Robot versions if a user happened to usethe oneparameter combination that used to work (other type combinations would also then not work).[3] Where
bytescan't be safely introduced 100%, we can leave it asstr, and there will be a few special cases where backwards compatibility cannot be maintained.Could you perhaps adjust the remaining places according to your preferences in the MR?
Otherwise, I think the discussions will drag on for a long time back and forth, even though the implementation is already 95% finished.
local latests and utests PASS but there is some empty error porblem in the pipeline:
silentw0lf commentedon Nov 23, 2025
The MR can be reviewed.
str | byteswere there should be no side effects (and added some tests).str | byteswhere different parameters could have different types (e.g.stringasstrandexcludeas bytes, and so on) -> left a comment at those functions withTODO(...pekkaklarck)if you want to discuss. They are of course removed when MR is ready.pekkaklarck commentedon Nov 27, 2025
I don't have time to review this now, but after XML finally being ready, this one is next in my agenda.
One thing I wanted to note is that String has some keywords that are affected by
#5558#5537. There's no need to deprecate anything as part of this issue, but it is likely that the affected keywords need to haveLiteral[""]as one accepted value for the start index. There ought to be tests for validating that the empty string is currently accepted and they ought to fail without that typing.silentw0lf commentedon Nov 30, 2025
here is a self reference: 5558 -> 5558
pekkaklarck commentedon Nov 30, 2025
Right, the correct reference is #5537.
pekkaklarck commentedon Dec 1, 2025
Implemented in PR #5554 by @silentw0lf. Thanks for the contribution!
Add type hints to String library (robotframework#5554)