Difference between C# ToString and python __str__ for lists
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
The issue concerns ansys-pythonnet's conversion of C# arrays and List objects when exposed to Python; no files, tests, or entry points are named. Start by locating the collection string-conversion path and compare CPython's list behavior with IronPython's str. Done means an explicit option produces the requested Python-style output for both arrays and List objects without changing the default behavior.
Written by the indexing model from the issue text.
Description
In python, if you have a list and you convert it to string via str(my_list), it will print out the entire list.
With C#, calling .ToString() on either an array or a List object will just print out that it is a list.
This leads to a difference in behavior between APIs exposed via CPython and APIs exposed by IronPython. With IronPython, a python list is internally a C# List, but it's __str__ method matches the behavior of a python list.
There should be an option in ansys-pythonnet to provide pythonic string conversions for C# collections.
- Dominant language
- C#
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ansys/ansys-pythonnet
-
Latest versions of ansys-pythonnet not in pkgs.dev.azure.com/pyansys/_packaging/pyansys/pypi/simple Open
Difficulty 4/5 3-5 days Newbie friendliness 25/100
ansys/ansys-pythonnet#26 · 2 comments ·
-
bug
Difficulty 4/5 3-5 days Newbie friendliness 30/100
ansys/ansys-pythonnet#14 ·
All issues in ansys/ansys-pythonnet
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·