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

add void type for returning nothing #8

Closed
wants to merge 1 commit into from
Closed

Conversation

raabf
Copy link

@raabf raabf commented Feb 24, 2015

It would be nice to have voidas an alias for type(None), e.g for returning Nothing, so that you can write something like:

@typechecked
def function(a: int) -> void:
    pass

voidis a very common keyword to indicate that a function returns no value, so for most users it is clear what voidindicates. It is faster to write and in my opinion better to read then type(None).

@dahlia
Copy link
Contributor

dahlia commented Apr 5, 2015

+1

@jan-matejka
Copy link

Should use just None to be consistent with pep 484

@raabf
Copy link
Author

raabf commented Jul 21, 2015

You mean Using None right? Automatically it does not work. Mhmm I personally find that strange since None (=instance) and type(None) (=type) is not the same and you had to detect the context. But yea you're right if PEP484 defines that we should follow this guideline. So lets change this MR to #10 .

@raabf raabf closed this Jul 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants