ansys / ansys/ansys-pythonnet

Difference between C# ToString and python __str__ for lists

Open
#25 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
0
Forks
1
PR merge metrics
No merged PRs in 30d

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.