Visitar URL original
meta-issue: overloading improvements · Issue #265 · pythonnet/pythonnet · GitHub
Skip to content

meta-issue: overloading improvements #265

Activity

  1. ArvidJB commented on Dec 27, 2016

    @ArvidJB
    Contributor

    How about the following idea: we could reuse the work that the DLR has already done to support correct overloading resolution (for IronPython). To use that we would first convert the Python arguments to their corresponding .NET types and then let the DLR decide which of the overloads to pick. This should add support for named arguments, generic type inference, etc.
    I tinkered with this a bit and I think it would work correctly, but it would be a fairly major piece of work. Do you think this is a worthwhile route to pursue? It would add a reference to https://github.com/IronLanguages/dlr to python.net by adding this NuGet package https://www.nuget.org/packages/DynamicLanguageRuntime/

  2. den-run-ai commented on Jan 6, 2017

    @den-run-ai
    ContributorAuthor

    @ArvidJB this is interesting suggestion. One problem I see is that conversion from Python to .NET types can still be ambiguous even before letting DLR to do the overloading resolution. For example, passing a float could be converted to a single or a double, passing an integer could be converted to int16, int32, or int64.

    Here are some comments from @matthid where he suggested to use Roslyn for this:

    #203 (comment)

  3. AlexCatarino commented on Feb 16, 2018

    @AlexCatarino
    Contributor

    @denfromufa, you haven't listed "named arguments".
    I guess it is not support by @ArvidJB's comment.
    Our experience at QuantConnect is that it is not. Could you please confirm?

  4. den-run-ai commented on Feb 16, 2018

    @den-run-ai
    ContributorAuthor

    @AlexCatarino probably not, can you provide a failing case not working for you?

  5. jaredbroad commented on Feb 16, 2018

    @jaredbroad

    Fairly specific to our API but: it silently defaults as if the named args aren't there.

    class BasicTemplateAlgorithm(QCAlgorithm):
    
        def Initialize(self):
    
            self.SetStartDate(2013,10,07)  #Set Start Date
            self.SetEndDate(2013,10,11)    #Set End Date
            self.SetCash(100000)           #Set Strategy Cash 
            self.AddEquity("SPY", Resolution.Minute, market=Market.USA, fillDataForward=False, leverage=1, extendedMarketHours=True)
            #self.AddEquity("SPY", Resolution.Minute, Market.USA, True, 1, True)
    
        def OnData(self, data):
            if not self.Portfolio.Invested:
                self.LimitOrder("SPY", 100, 200)
    

    In the working case the trade occurs at 4.01am; in the default case its 9.31am.

    https://www.quantconnect.com/terminal/processCache/?request=embedded_backtest_fa3f24864893dd26a7ed8d5a7d23a336.html

  6. den-run-ai commented on Dec 9, 2018

    @den-run-ai
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions