Skip to content

Why do type hints not work? #802

@Msavage314

Description

@Msavage314

For example this code:

#!/usr/bin/env python3

s: str = ""

raises this error:

  File "/home/robot/Robotic arm/test.py", line 4
    s: str = ""
     ^
SyntaxError: invalid syntax

Is this due to a different python version? If so, how can I update it?
I want this because I am using rpyc to connect to another ev3dev brick, and want to type hint the remote motors to get intellisense, inspection... etc. I am running from vscode on windows 11 to a python ev3dev brick connected over a cable. The brick info is:

  • brickman: v0.10.3
  • kernel: 4.14.117-ev3dev-2.3.5-ev3
  • I am on python version 3.5.3 according to sys.version

I have tried running sudo apt-get update and upgrade, but it doesn't change the version

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