Optuna: Use variable annotation syntax for Type Hints

Created on 5 Oct 2020  路  3Comments  路  Source: optuna/optuna

Motivation

After dropping Python 3.5 (#1067), we can use type hints with variable annotation syntax.

https://www.python.org/dev/peps/pep-0526/

Description

Thank you @harupy for creating a script to detect type comments for variables!
https://github.com/optuna/optuna/issues/711#issuecomment-683521987

Additional context (optional)

contribution-welcome feature good first issue

All 3 comments

I have tested com2ann (which translates type comments into type annotations) and it worked.

Usage:

# install python 3.8 (because com2ann doesn't work in python < 3.8)

# install com2nn
pip install git+https://github.com/ilevkivskyi/com2ann.git

# run com2ann
com2ann .

I confirmed that all comment-style variable annotation are replaced at #1950.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nyanp picture nyanp  路  3Comments

dwiel picture dwiel  路  4Comments

CMobley7 picture CMobley7  路  3Comments

uvinetz picture uvinetz  路  3Comments

bjoernholzhauer picture bjoernholzhauer  路  3Comments