Skip to content

[Python] Overloads like foo(bool=true) not correctly resolved #16573

@guitargeek

Description

@guitargeek

Reproducer:

python
>>> import ROOT
>>> ROOT.RooFit.Minos(1).getSet(0).Print("v")
  1) 0x6535abd27b70 RooConstVar:: 1 = 1  "1"

Should be like in C++:

root [1] RooFit::Minos(1).getSet(0)
(const RooArgSet *) nullptr

The function has overloads like this:

RooCmdArg Minos(bool);
RooCmdArg Minos(RooArgSet const&);

The RooArgSet has a constructor RooArgSet(double) which is accidentally taken by PyROOT here, even though the call to Minos(bool) would be correct.

This caused some bad experience for users who tried to enable Minos for all parameters with Minos(1), resulting in nothing happening (Minos was only attempted for this constant "1" parameter, which of course does nothing).

Not a high priority in this case because the workaround is easy: Minos(True). But it's very possible that users are also bitten in other cases by this faulty overload resolution, so we need to fix it.

Metadata

Metadata

Assignees

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions