- Notifications
You must be signed in to change notification settings - Fork749
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
1ef1e7b
255201a
37c4d04
4fbf04c
cf8ff1f
bc11136
1073b03
b5a18d1
37ec583
ad7f985
bac598f
e04b6c4
8bb7519
File 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> | ||
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 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 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. | ||
} | ||
} |
Uh oh!
There was an error while loading.Please reload this page.