Skip to content

Variables types to avoid vscode trick #3

@CremaLuca

Description

@CremaLuca

Instead of this weird vscode trick:

def __init__(self, car, controller, controller_sp, env, detection, path_planner, checkpoints=None, desired_speed=0.3, debug=True):
print("Initialize brain")
self.car = Automobile_Data() #not needed, just to import he methods in visual studio
self.car = car

One could use python typization features:

    def __init__(self, car: Automobile_Data):
        self.car = car

And vscode would recognize the available methods and attributes in self.car are the ones of instances of class Automobile_Data

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions