Skip to content

Regression in i-adding array.array to std::vector in PyROOT #18768

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

Open
1 task
lwpiotr opened this issue May 18, 2025 · 0 comments
Open
1 task

Regression in i-adding array.array to std::vector in PyROOT #18768

lwpiotr opened this issue May 18, 2025 · 0 comments

Comments

@lwpiotr
Copy link

lwpiotr commented May 18, 2025

Check duplicate issues.

  • Checked for duplicates

Description

In (Py)ROOT 6.30.06 one can properly += (iadd) an array.array to an std.vector. In the current master, this operation changes the type from (in my test case) cppyy.gbl.std.vector to cppyy.gbl.__gnu_cxx.__normal_iterator<unsigned short*,vector >, which is not compatible with the standard vector.

+= with nested list of arrays was the only way known to me to assign values to a nested std::vector with ROOT 6.30.06. It seems that now .assign(nested pure list) works. So, detecting the user's ROTO version, I can easily make my code work (however dirty the hack with the ROTO version is). Still, I wanted to report the regression and also the fact, that += nested list doesn't work (while the assign() does).

Reproducer

import ROOT
import array
d = ROOT.vector("unsigned short")()
a = array.array('H', [0, 1])
d+=a
print(type(d))

ROOT version

heads/master@v6-37-01-6541-g9a9e7697e4

Installation method

Self compilation

Operating system

Fedora 42

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants