https://reviews.llvm.org/D158974 Implement __<type>__ functions for
bool, float, int, and str for automatic casts in functions bound
by pybind11. This patch tests their behavior more thoroughly. In
particular, this clarifies an open question from the dicussion of above
patch: values for string parameters, unlike for the other types, are
*not* cast implicitly with str(.)
Details
Details
- Reviewers
rkayaith springerm ftynse nicolasvasilache
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Is there still a reason to implement __str__ for StringAttr then? It seems to just add inconsistency, as the implementation on every other attribute gives the asm string.
Comment Actions
Do these tests provide value beyond finding out how __str__ and pybind11 interact? If yes, I guess I'll rebase this patch on top of https://reviews.llvm.org/D159255 and land (after approval)...
Comment Actions
I think only the positive tests for Attribute conversions are really relevant. And since that's covered by tests in the original change, it seems fine to drop this patch.
Comment Actions
The only thing that isn't tested that explicitly in the attributes tests is that the automatic conversion done by pybind works as expected. But in a way that's a pybind feature... Abandoning.