Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utilize types in the Python docs #2959

Open
lukicdarkoo opened this issue Apr 12, 2021 · 5 comments
Open

Utilize types in the Python docs #2959

lukicdarkoo opened this issue Apr 12, 2021 · 5 comments
Labels
documentation Improve or fix the documentation (MD files only, no software development) good first issue Could be addressed by a newbee contributor

Comments

@lukicdarkoo
Copy link
Member

lukicdarkoo commented Apr 12, 2021

Maybe, the Python documentation would be more readable by utilizing the Python typing. For example, instead of:

from controller import Node

class Node:
    def getId(self):
    def getDef(self):
    def getParentNode(self):
    def isProto(self):
    def getFromProtoDef(self, name):

we could write

from controller import Node

class Node:
    def getId(self) -> int:
    def getDef(self) -> str:
    def getParentNode(self) -> Node:
    def isProto(self) -> bool:
    def getFromProtoDef(self, name : str):

The same applies to the implementation.

@lukicdarkoo lukicdarkoo added good first issue Could be addressed by a newbee contributor documentation Improve or fix the documentation (MD files only, no software development) labels Apr 12, 2021
@omichel
Copy link
Member

omichel commented Apr 12, 2021

Since which version of Python were these python types introduced?

@lukicdarkoo
Copy link
Member Author

lukicdarkoo commented Apr 12, 2021

From 3.5:
https://docs.python.org/3.5/library/typing.html

I don't know whether it is backported to 2.7, but I guess we will drop the support for 2.7 soon

@omichel
Copy link
Member

omichel commented Apr 12, 2021

Yes, we will drop 2.7 soon, so, it shouldn't be an issue. I just wanted to check this feature was not too recent (e.g., Python 3.8 or the like).

@stefaniapedrazzi stefaniapedrazzi added this to the R2021b.rev1 milestone May 26, 2021
@omichel omichel modified the milestones: R2021b-rev1, R2021c-rev1 May 26, 2021
@omichel omichel modified the milestones: R2022a-rev1, R2022c Jun 13, 2022
@ygoumaz
Copy link
Contributor

ygoumaz commented Nov 8, 2022

Closing as duplicate of #2385.

@ygoumaz ygoumaz closed this as completed Nov 8, 2022
@ygoumaz ygoumaz reopened this Nov 8, 2022
@ygoumaz
Copy link
Contributor

ygoumaz commented Nov 8, 2022

Closing #2385 instead is better.

@ygoumaz ygoumaz modified the milestones: R2023a, R2023b Nov 8, 2022
@BenjaminDeleze BenjaminDeleze modified the milestones: R2023b, R2024a Jun 12, 2023
@gabryelreyes gabryelreyes removed this from the R2024a milestone Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improve or fix the documentation (MD files only, no software development) good first issue Could be addressed by a newbee contributor
Development

No branches or pull requests

6 participants