Python Type Checker Mypy receives experimental semantic analyzer

Mypy is an optional static type checker for Python. In version 0.710 he brings along a new feature: an experimental semantic analyzer. The details were presented by Guido van Rossum on the Mypy blog.

In PEP 484 type hints for Python were introduced, whereupon static type checking became possible. One of the tools developed for this purpose is Mypy. Python inventor Guido van Rossum is also involved in the project, which is why he presented the new semantic analyzer and the other features in Mypy 0.710 in a blog entry.

Experimental semantic analyzer

The new release Mypy 0.710 has an experimental semantic analyzer on board. The new component binds names to definitions. It should keep track of what each name defines, eg. For example, a function or a type alias. It is a revised version of the semantic analyzer, which is why it is called a new semantic analyzer. Above all, the handling of import cycles and forward references should have improved in the new version.

The new semantic analyzer can be activated in two ways: either through the command-line –new-semantic-analyzer or by setting new_semantic_analyzer = True in the Mypy configuration file, usually mypi.ini . For more information about activation, see the documentation .

Other features in Mypy 0.710

Other new features in version 0.710 include additional in-line configuration capabilities. By per-file configuration flags in # Mypy: comments z. Eg # Mypy: no-strict-optional at the beginning of the file. This will disable strict optional checking for this file. In addition, the new release contains some more new features as well as inference improvements and bug fixes.

Mypy is available via PyPI (Python Package Index) . There is already the current version 0.711 ready, which fixes two minor bugs from Mypy 0.710.

On the Mypy blog, Guido van Rossum introduced the new features in version 0.710 and described the bug fixes in version 0.711.

Recent Articles

Angular 9 Next Versions: Ivy, Bazel and more

Angular 9 next versions are here. Besides updates to Ivy, the update includes three features for the Language Service and Service Worker and changes...

Google Releases Dart 2.5: Code Completion through Machine Learning

The latest version of Googles C-Alternative, Go 1.13, is barely released, as the JavaScript derivative of the Internet giant follows: Dart 2.5 is here!...

Laravel 6.0 is here: Support for Serverless Platform Laravel Vapor

A new update is available for the framework Laravel. Laravel 6.0 is compatible with Laravel Vapor, a serverless deployment platform. The development team has...

Microsoft’s FaaS service Azure Functions: Now with Python support

Azure Functions has received support for Python: Microsoft's FaaS service can host Python workloads for data science, machine learning, and more. So far, the...

On the way to Angular 9: Three bugfixes in Angular 9

With Angular 9.0.0-next.1 there is a second Next-Release available for Angular 9, which can now be tested. The number of changes to the version...

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here