Skip to content

Handle C# Interfaces as Parameter Type #16

@AlexCatarino

Description

@AlexCatarino

Python doesn't have interfaces like C#, so the stubs should find a way to avoid adding overloads with interface arguments. For example:

// In IndicatorBase class
public abstract bool Update(IBaseData input);

Becomes:

@overload
def Update(self, input: QuantConnect.Data.IBaseData) -> bool:
    """
    Updates the state of this indicator with the given value and returns true
    if this indicator is ready, false otherwise
        
    :param input: The value to use to update this indicator
    :returns: True if this indicator is ready, false otherwise.
    """
    ...

Result:

Screenshot_from_2023-09-13_12-02-28

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions