- Notifications
You must be signed in to change notification settings - Fork767
AddedToPythonAs() extension method for explicit conversion using an arbitrary type#2419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
1ef1e7b255201a37c4d044fbf04ccf8ff1fbc111361073b03b5a18d137ec583ad7f985bac598fe04b6c48bb7519File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -2,6 +2,7 @@ | ||
| <PropertyGroup> | ||
| <TargetFrameworks>net472;net6.0</TargetFrameworks> | ||
| <RollForward>LatestMajor</RollForward> | ||
Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. This allows anyone that has recent versions of .net to run these tests. I can revert but I think its usefull, otherwise one needs to install .net6 which is already deprecated Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. I think this should be conditioned on not running in CI Author There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Is there any config/env var which I can check? | ||
| <AssemblyOriginatorKeyFile>..\pythonnet.snk</AssemblyOriginatorKeyFile> | ||
| <SignAssembly>true</SignAssembly> | ||
| </PropertyGroup> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -983,9 +983,14 @@ public static PyObject ToPython(this object? o) | ||
| } | ||
| public static PyObject ToPythonAs<T>(this T? o) | ||
| { | ||
| return ToPythonAs(o, typeof(T)); | ||
| } | ||
| public static PyObject ToPythonAs(this object? o, Type type) | ||
| { | ||
| if (o is null) return Runtime.None; | ||
| return Converter.ToPython(o,type).MoveToPyObject(); | ||
| } | ||
joaompneves marked this conversation as resolved. Show resolvedHide resolvedUh oh!There was an error while loading.Please reload this page. | ||
| } | ||
| } | ||