Skip to content

Type Hints for Globals #1091

Answered by srittau
dineshbvadhia asked this question in Q&A
Feb 23, 2022 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

You can just define X: int in the global scope without an assignment:

X: int

def read_data():
    global X
    X = db_read()

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@dineshbvadhia
Comment options

@JelleZijlstra
Comment options

Answer selected by dineshbvadhia
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants