allow .NET classes to override __getattr__ and __setattr__ by lostmsu · Pull Request #901 · pythonnet/pythonnet
Repository navigation
allow .NET classes to override __getattr__ and __setattr__ - #901
Closed
lostmsu wants to merge 3 commits into pythonnet:master from losttech:PR/GetSetAttr
Closed
allow .NET classes to override __getattr__ and __setattr__ #901 lostmsu wants to merge 3 commits into pythonnet:master from losttech:PR/GetSetAttr
Conversation
lostmsu commented Jun 26, 2019 · edited Loading
Copy link Copy Markdown
Member
What does this implement/fix? Explain your changes.
This enables .NET classes to override __getattr__ and __setattr__ by implementing IGetAttr and ISetAttr interfaces correspondingly.
How does it work
When constructing a Python type, that will represent C# type, if the C# type implements one of the interfaces, fill corresponding slots in the Python type with custom handlers for tp_getattro or tp_setattro with implementations from slots.cs.
Checklist
Check all those that are applicable and complete.
- Make sure to include one or more tests for your change
- If an enhancement PR, please create docs and at best an example
- Add yourself to
AUTHORS - Updated the
CHANGELOG
P.S.
This is a single-commit change. Probably could be cherry-picked merged without a merge commit.
lostmsu force-pushed the PR/GetSetAttr branch fromaba6217 to
4730c05
Compare
June 26, 2019 20:51
lostmsu commented Jun 26, 2019
Copy link Copy Markdown
Member
Author
|
Looks like .csproj files have varying line endings. Do you guys know how to enforce them in the future? |
4730c05 to
eb6577f
Compare
June 26, 2019 22:04
lostmsu commented Jun 28, 2019
Copy link Copy Markdown
Member
Author
|
@filmor any idea why that change could have broken x86 tests? I just tried to run Python.EmbeddingTest on Windows with x86, and did not get any crashes or issue? Could it be, that a simple rerun needed (then how to do it?)? |
b3fc2a1 to
41dbcb7
Compare
June 28, 2019 06:50
filmor commented Jun 28, 2019 · edited Loading
Copy link Copy Markdown
Member
|
It looks good now. Regarding the line endings: IMO we should always have Unix style line-endings everywhere. We could set up a I use the setting |
lostmsu commented Jun 28, 2019
Copy link Copy Markdown
Member
Author
|
@filmor I don't think it does. x86 builds are still failing in appveyor (unlike, for example, trivial C# version change). |
lostmsu commented Jun 28, 2019
Copy link Copy Markdown
Member
Author
|
Damn, Hyper-V on Windows 10 does not boot x86 linuxes (tried Ubuntu 16.04, 18.04 and the latest Debian) |
allow .NET classes to override __getattr__ and __setattr__
1b17743
lostmsu
force-pushed
the
PR/GetSetAttr
branch
from
85025f8 to
1b17743
Compare
August 23, 2019 19:28 lostmsu mentioned this pull request Aug 23, 2019 New test class causes crash on x86 with
PythonEngine.Initialize
#946
Closed
lostmsu
and others
added 2 commits
August 23, 2019 13:26
removed initialization from TestInstanceWrapping, as it partaken in t...
5e276d9
...ests crashing under x86 (opened bug pythonnet#946)
Merge branch 'master' into PR/GetSetAttr
4f9e29e
lostmsu commented Oct 21, 2019
Copy link Copy Markdown
Member
Author
|
Closing this out, as we decided on ad-hoc approach instead (e.g. one should simply have a |