Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Thoughts on PEP8 adaptor for calling .NET code from Python#2317

koubaa started this conversation inGeneral
Discussion options

I use pythonnet to expose C# classes and libraries to python users, and a lot of the feedback I get sounds like "Can't this API be more pythonic and pep8?"

I can sympathize with that. In my .NET code, I wouldn't want to see unusual styles coming from a library that I want to use, but my C# libraries and classes are also exposed to C# users, so I am not going to change them.

Would there be an appetite for implementing within pythonnet or as some kind of plugin a pep8 adaptor, such that a C# class like this:

namespace A.B {    class Foo {        public string Bar;        public int QuuxBaz() => 1;    }}

can be used from python like this:

from a.b import Foofoo = Foo()foo.bar = "hello"print(foo.quux_baz)

Obviously, it doesn't need to transformeverything, (even without namespaces getting transformed, the above would still look more pythonic). And if it isn't possible because of collisions, maybe something should be logged somewhere and no transformation would be done. And it probably shouldn't be done by default.

With all those caveats in mind, what do you all think?

You must be logged in to vote

Replies: 0 comments

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
1 participant
@koubaa

[8]ページ先頭

©2009-2025 Movatter.jp