New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove positional arguments from PSet.clone() #23566
Remove positional arguments from PSet.clone() #23566
Conversation
I don't know any use case for positional arguments for PSet.clone(). Allowing them may lead to difficult-to-detect bugs like PSet.clone(dict(foo = ...)) (which happened).
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-23566/5158 |
A new Pull Request was created by @makortel (Matti Kortelainen) for master. It involves the following packages: FWCore/ParameterSet @cmsbuild, @smuzaffar, @Dr15Jones can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild, please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2) |
Comparison is ready Comparison Summary:
|
+1 |
There was a bug in #23363 (already fixed in the PR) using a pattern
FooPSet.clone(dict(foo = dict(...)))
to clone aPSet
. Because of the leadingdict
the clone was not modified, and it took a while to realize the cause. A simple way to detect this kind of bug would be to forbid positional arguments toPSet.clone()
(as in this PR). I am not aware of any use cases for them (and e.g.Modifier.toModify()
does not allow positional arguments, except for customizing with a function).The error message from python is
which may be a bit difficult to interpret. Alternatively we could keep the positional arguments and raise our own Exception with an easier-to-understand message if any positional arguments are given.
Tested in CMSSW_10_2_X_2018-06-10-2300, no changes expected.
@Dr15Jones