[PyROOT] cppyy selects explicit template instantiation
Los mantenedores suelen responder en 1 día
@guitargeek ya está trabajando en esto.
Desde el 19/2/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Check duplicate issues.
- Checked for duplicates
Description
When a function takes a mandatory template argument that also cannot be deduced, cppyy sometimes uses an explicit instantiation.
Reproducer
>>> import ROOT
>>> ROOT.gInterpreter.Declare("template <typename T> std::size_t get_size() { return sizeof(T); }")
True
>>> ROOT.gInterpreter.Declare("template std::size_t get_size<int>();")
True
>>> ROOT.get_size()
4
>>> ROOT.get_size[""]()
4
I would expect the call to fail:
>>> import ROOT
>>> ROOT.gInterpreter.Declare("template <typename T> std::size_t get_size() { return sizeof(T); }")
True
>>> ROOT.get_size()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Template method resolution failed:
Failed to instantiate "get_size()"
>>> ROOT.get_size[""]()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Could not find "get_size<>" (set cppyy.set_debug() for C++ errors):
Failed to instantiate "get_size<>()"
Interestingly, the behavior is different after it failed once:
>>> ROOT.gInterpreter.Declare("template std::size_t get_size<int>();")
True
>>> ROOT.get_size()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Template method resolution failed:
Failed to instantiate "get_size()"
>>> ROOT.get_size[""]()
4
>>> ROOT.get_size()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: Template method resolution failed:
Failed to instantiate "get_size()"
Now it only works with get_size[""]()...?!
ROOT version
master
Installation method
from source
Operating system
Linux
Additional context
No response
- Lenguaje dominante
- C++
- Estrellas
- 3.3k
- Forks
- 1.6k
- Merge medio
- 2 d 16 h
- PR fusionados (30 d)
- 194
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de root-project/root
-
thisroot.sh: wrong ROOTSYS in zsh when the shell's command line has a newlinePosiblemente ocupada @dpiparo la tomó hace 3 días. Abiertobug in:Build System
Dificultad 2/5 1-3 horas Aptitud para principiantes 86/100
root-project/root#23746 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[tmva][sofie] Inputs of unsupported type (e.g. float16) give code that does not compile instead of an errorPosiblemente ocupada @lmoneta la tomó hace 12 días. AbiertoAI-Assisted bug in:SOFIE
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
root-project/root#23655 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 71/100
root-project/root#23790 ·
Los mantenedores suelen responder en 1 día
-
bug in:Core Libraries
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
root-project/root#23777 ·
Los mantenedores suelen responder en 1 día
-
`TChain::GetEntries` internal caching ineffective?Posiblemente ocupada @pcanal la tomó hace 5 días. Abiertoimprovement in:TTree
root-project/root#23738 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de root-project/root
Issues similares
-
Add string concatenationAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
Los mantenedores suelen responder en 1 día
-
Bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Failed-capture notification says "Save diagnostics for this upload" when nothing was uploadedAbiertoarea: ui bug good first issue P2: medium value: medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
patrick-hudson/put.gd-desktop#366 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Niko1221/Strata#3673 · 2 comentarios ·
Los mantenedores suelen responder en 3 días