Adding a 'pure' function type annotation? · Issue #4468 · python/mypy · GitHub
Skip to content

Adding a 'pure' function type annotation? #4468

Description

@wizzardx

This is a feature request.

If a function is annotated as 'pure', then it's checked that it doesn't operate against global state. ie, always returns inputs based only on arguments passed to it, and it doesn't do IO.

Also, functions annotated as 'pure' can only call other functions annotated as 'pure'

More or less, how the D lang describes them:

https://dlang.org/spec/function.html#pure-functions

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions