PyCharm 5.0.2 EAP build 143.1015.4 is Available

Today we announce the second early preview build of PyCharm 5.0.2. The list of bug fixes and improvements for this build can be found here.

Some highlights of the PyCharm 5.0.2 build 143.1015.4 are:

  • fixes for different performance issues
  • fixes for docstrings support
  • a number of fixes for scientific tools, including IPython Notebook, matplotlib and miniconda support
  • a number of fixes for debugger
  • fixes for Docker and remote interpreters support
  • a fix for Django support
  • and more

Please give PyCharm 5.0.2 EAP a try before its official release and please report any bugs and feature request to our issue tracker.

Develop with Pleasure!
-PyCharm team

Posted in Early Access Preview | 1 Comment

Python 3.5 type hinting in PyCharm 5

Python 3.5 introduces type hinting to help code-writing during development. Let’s take a look at this feature and show it in action.


Some folks, but not all, like help from their tools when writing code and documentation. For example, lint-like tools can spot errors before your code executes, and editors and IDEs can harness that to show you mistakes, as you type. Particularly for large code bases and large teams, such help is quite valuable.

These mistakes can include passing the wrong type of value to a function. Wouldn’t it be great if you could get that help once typed, or even as you are typing (autocompletion)? Other languages have some concept of type checking. We don’t want to turn Python into a strongly-typed language. But can’t we get a little help?

Python’s PEP 484 brings optional type hinting to Python 3.5. Using the typing module, you can provide type hint information in your code. This can be used by yourself or others to flag certain problems, while you are developing.

Quick Example

Code speaks, so let’s start with an example. mypy was the originator of Python 3.5’s typing module. Let’s use one of its examples:

This example shows the most important part of type hinting: it is optional. Python hasn’t changed to suddenly require static typing. But if we add a little more:

…then we can let an IDE such as PyCharm help us:


What Is (and Isn’t) Type Hinting?

There’s a lot of apprehension out there about this new language feature. Before showing more in-depth code, let’s try to clear this up. First, here’s what type hinting is for:

  • Develop better/faster. Think of it like linting, or as Guido said, “linting on steroids”. With the right tools, it can surface mistakes more quickly.
  • Help users of your code. If someone wants to use your function, type hinting helps explain (autocomplete) and flag when they mess up.
  • Documentation. Rather than pack argument and response type information into carefully-formatted docstrings, use something in the language.

So that’s the benefit, but what is type hinting not?

  • Not required. You can ignore it. You can use it a little. You can use it a lot. It’s all the same. Heck, Python itself (at runtime) ignores type hinting.
  • Not static typing. This is not, not, not changing Python into Java. The language is not enforcing anything.
  • Not Performance boosting. Providing type information makes people think of compilation speedups. But this has no impact on Python execution. Also, the Cython and PyPy teams have said these type hints are unlikely to make a difference to them for speedups.
  • Not incompatible. The extra characters added into your code are ignored by older versions of Python 3. This requirement – to be syntactically-valid pre-3.5 – was a constraint on the options for expressing the hints. If you’re one that thinks the syntax is ugly, this constraint is likely to blame.

Type hinting is most useful when you share your code with a consumer: when you publish a library, or code in a project with others, or helping out your future self who needs to live with the sins of your current self.

With all that preface out of the way, let’s take a look at some usages.


The teeny-tiny examples above just cover a single argument or return value. What if I want to say hello to a list of names?

Python 3.5’s type hinting provides an answer for this. Namely, you can express the hint as “a list of strings”:

What happens if we ignore the hint and supply a list of integers? PyCharm warns us:


PEP 484 refers to hints such as List as “generics”. That is, a hint that contains other hints. An Iterator for example is a list-y kind of generic. As you would expect, dictionaries are supported:

In this case we see an unusual-looking structure: Dict[str, int]. Think of the values between the brackets as “arguments” to the generic Dict type. The first argument is the type of the dictionary keys. The second is the type of the dictionary values.

Optional Values

We are now passing in a string to use for formatting. But maybe we’d like our class to provide a default string. Let’s allow None as a value that can be passed in, in addition to a string:

Alas, type hinting now warns us that the first argument has to be a string:


Fortunately there are several ways to solve this, each useful in various circumstances. For example, we could use regular Python and make this a keyword option with a default:

With this, you can omit passing in a format string and instead use a value of None. (Of course, you could skip the following test and just make the format string the keyword default.) If you pass in an integer, though, you’ll get warned:


Here’s another variation: allow your users to pass in a formatting string or False:

The Union type from typing, as shown here, lets the type be from any of the provided type values. In this case, str or bool.

Here, though, is the approach that best conveys the meaning of optional:

That is, PEP 484 type hinting defines a generic type of Optional.

String-Based Hints

I follow a pattern where I use a static method on my class to query for instances. Hey, I saw someone smart post it once, don’t judge me. For example, in a SQLAlchemy model:

Unfortunately, that fails. As the mypy docs explain: “Python does not allow references to a class object before the class is defined.”:


To fix this, type hinting has the concept of a forward reference. In the location where you would normally provide the hint, just provide that same hint, but in a string:

This lets the Python interpreter parse the module at import time, then deal with the type hinting later.

Stub Files

As mentioned in the introduction, some people might find all this type hinting to be noise that distracts from the readability of the code. Wouldn’t it be great if you could get the benefits of type hinting, but keep that information separate? Or in other cases, you can’t actually put in the type hints: it’s in old version of Python code (before function annotations), or in C code, or in code you don’t control.

For these cases, Python type hinting provides stub files. These are extra files, named the same as the module they are stubbing, which contain the type hints. For example, imagine we have a simple function in a module with a filename of

No type hinting. Then, imagine a second file, in the same directory, named greeting.pyi:

The addition of the .pyi suffix makes this shadow the original module. PyCharm helps by denoting the stubbing with an asterisk in the gutter, and a mouseover gives more detail:


If we now try to “break the rules” of type hinting, we’ll get the same effect we would if we put the type hints directly in our code:


Type Aliases

Sometimes the function arguments and return values can get quite unwieldy. Imagine a greeting function which could accept either a list of strings, or a dictionary where each value is a list of strings. Based on this, you’d also need return different types of values.

Here’s what the type hinting would look like:

Gorgeous, isn’t it? Well, not so much. For cases like this, Python 3.5 type hinting provides a type alias: a way to define the type hint information in one place, then use it in one or more other places. Let’s define a type alias for a GreetingType:

That’s a lot tidier, letting the function usage concentrate on the meaning and the declaration contain the noise….erm, provide the detail.

And yes, this section was added in response to a StackOverflow complaint about the unwieldy syntax.


For the audience that wants tools to warn them earlier, Python 3.5 type hinting is very valuable. But not everybody falls into that category. They might use simpler editors. Or they might view those extra characters as seriously breaking Python’s readability.

In theory the answer is simple: “Then don’t use type hinting, it’s optional.” But the worry is that if type hinting becomes “best practice”, library authors will be pressured into supporting it. At that point, adoption will go up and you’ll constantly come across Python code that gouges your eyeballs. It won’t feel so optional then.

On the other side of the argument, some might wish it went further. Perhaps it should cover more cases. Perhaps it should bend the language syntax further to avoid the forward-reference comment-based type hinting, or provide a less line-noise-looking way to express complicated typings.


That’s a walkthrough Python 3.5 type hinting: what it is and isn’t, and ways that it can help you write quality code faster. This article isn’t an exhaustive treatment of all the options. For more information, take a look at the mypy examples and PEP 484.

Posted in Cool Feature, Tutorial | 18 Comments

Interview with Quazi Nafiul Islam, Author of ‘Mastering PyCharm’

1316OTPublished a few weeks ago, Mastering PyCharm by Quazi Nafiul Islam reveals the best development practises using PyCharm. Relying on his extensive programming experience using PyCharm, in his book Nafiul delves into essential topics of setting up PyCharm for your needs and then getting the most out of its numerous development features, ranging from the editor basics, setting up look’n feel and essential shortcuts all the way to specialized tools for debugging, version control and web programming. ‘Mastering PyCharm’ is recommended for both beginning Python programmers and those coming to PyCharm from other IDEs or text editors.

We seized the opportunity and interviewed Nafiul. Read on to learn more about the man, his programming experience and his vision.

- Hi Nafiul, could you tell us a bit about yourself and your occupation?

I’m a consultant at my day job, what that basically means is that I deal with a whole range of things from helping startups build their MVP to helping companies optimize their applications (mostly web applications), to even being a support engineer and developer evangelist. I try out different roles, because I want to learn more about software development as a process.

- How long have you been using PyCharm and why you find it as the best tool for Python development?

I’ve been using PyCharm for the past three years. I initially started with just Notepad++. What got me hooked initially was the code completion, but what kept me with PyCharm for so long was that you guys kept on bringing out good feature after good feature, and you went further than any other IDE out there. You folks really delivered on making workflow better.
But, what I also must acknowledge, is that PyCharm not only made me more productive because of code completion and python specific tools, but also because navigation with “Go To Action” and the newer “Search Everywhere”. Also, a lot of people don’t know this, but keymaps and snippets are highly customizable to do almost anything you might desire.

- Had you also used other IDEs or text editors? If yes, could you tell us why you switched from them over to PyCharm?

Many. I’ve tried out Emacs, Atom, Sublime Text, Komodo, Wing, PyDev, NinjaIDE and some others. I’ve never switched though for the single reason that none of them provided the kind of code completion that PyCharm did. PyCharm will even parse your docstrings for completions. Even the community edition of PyCharm is better than some paid editors when it comes to code completion. And that’s just code completion, don’t get me started on navigation, debugging and all the other good stuff.

However, I have to say that PyCharm cheats a little here. For example, you guys knew that it’d be hard convincing vim users to use PyCharm, so you went ahead and created an emulator for vim. That’s what I love about PyCharm, you folks know what people want before people even think of wanting it. So for a lot of people who “switch” over to PyCharm aren’t really switching, they can get the functionality they love in another editor as a plugin most of the time. For example, I love Emacs’ Ace Jump mode. After John Lindquist built the Ace Jump plugin, I rarely used Emacs anymore.

- How much time did it take you to learn PyCharm from scratch? Do you think learning tools is a big part of a developer’s trade?

To use it as well as I do now, it took some time. But, people get the wrong idea when I tell them that. You can be very productive with PyCharm with knowing very little, and you can use “Go To Action”, “Search Everywhere” and the Keymap to just quickly use the shortcuts you end up using the most (there’s even a plugin for making you use more shortcuts). Just by using those three things you’d be much more productive than most other IDEs out there. But you’d get a lot more if you learn about how to use VTL to create your own templates. There’s a tonne more to learn as well, but learning those things will make you more productive and less prone to making some rookie mistakes.

Do I think learning tools are a big part of a developer’s trade? Absolutely. Tools matter immensely when it comes to building things, good tools will help you get the job done with minimal frustration, you’ll enjoy your work more for it too.

- What are your favorite PyCharm features that you can’t imagine working without?

“Search Everywhere”, “Go To Action”, The Debugger and TypeScript stub support for JS code completion (if you use the professional version).

- As a bare minimum, what subsystems and features should new PyCharm users learn first of all?

I think of this as a tree, as I’ve alluded to before. Learn how to use the keymap (which will help you with shortcuts), then learn how to use Search Everywhere, and then learn to use the debugger. I assure you, you will be orders of magnitude more productive if you go down this path.

- Every serious project is not only about Python. It often involves testing, isolation of environment, deployment, version control, and database management. How does Pycharm help manage all this stuff?

Well, that’s the thing PyCharm isn’t only about Python, it’s about a lot of other things as well. It has an amazing database manager, you have JavaScript support, and live debugging. There’s so much stuff packed into a single IDE that it’s ridiculous sometimes.

- What other developer tools help you be more productive? Would you recommend any to other Python developers?

Dash. It basically allow you to search documentation offline very quickly. Probably *the* most useful tool for me other than PyCharm. Dash is for Mac OS, but there is a free alternative called “Zeal”, and it works on pretty much any platform and uses the same doctests that dash does.

- There are several Web frameworks backed by Python, including Django, Flask, Pyramid, and Google App Engine. What are your personal and professional preferences?

Flask. Everything else feels over-engineered, too complicated or designed to build only one kind of web application. Flask is beautifully designed, has a whole host of plugins, and is also very easy to extend.

- There are two major versions of Python currently co-existing: 2.x and 3.x. What do you think about the current state of Python? What’s your take on the future of the language?

I don’t really see it like that. I see fast python and slow python. In other words, if you’re focusing on the language divide, you’re missing the bigger picture. Right now, Python needs fast implementation, and so you’ll see a lot of implementations like pypy and pyston try to solve this problem. They are both mostly focused on python 2. So, in the future, whatever implementation solves the speed problem and provides good stability will win, and whatever version of the language it supports will therefore win. In the world of software, speed talks, and whatever is fast with a good level of abstraction to get the job done will win in the end.

– What do you think makes Python unique as a language?

It feels like writing pseudocode most of the time. It’s just so easy to read. I’ve used plenty of other languages, but nothing feels as readable as python.

- Please recommend two other books on development you enjoyed reading recently or just consider important.

I learned a lot from the Algorithm Design Manual. It is by far the best book out there if you want to understand and use algorithms (and data structures) practically. If you’ve tried reading CLRS and hated it, this is the book for you.

I would highly recommend “What If” by Randall Munroe. I don’t know what you’ll take away from reading this book, but you’ll definitely enjoy reading it.

- Thank you for the interview, Nafiul!

Photo_on_10-7-14_at_11.21_AMQuazi Nafiul Islam is a consultant, speaker and, most recently, an author.

You can buy ‘Mastering PyCharm’ by Quazi Nafiul Islam here. He also runs his own blog (, so check it out!

Posted in interview | 1 Comment

PyCharm 5.0.2 EAP is Available

It’s been a while since we released PyCharm 5 and today we announce the early preview build of PyCharm 5.0.2. The list of bug fixes and improvements for this build can be found here.

Some highlights of the PyCharm 5.0.2 build 143.869.1 are:

  • fixes for different performance issues
  • a fix for Google docstrings support (PY-17220)
  • a fix for code completion not working in IPython Notebook (PY-16392)
  • a number of fixes for Docker support
  • fixes for integrated test runner
  • a few fixes for Django support
  • and much more

Please give PyCharm 5.0.2 EAP a try before its official release and please report any bugs and feature request to our issue tracker.

Develop with Pleasure!
-PyCharm team

Posted in Early Access Preview | 8 Comments

PyCharm 5.0.1 update released

Just one week after the PyCharm 5 release, we bring you a bug-fix update, PyCharm 5.0.1, available from the download page. It will also be available shortly as a patch update from within the IDE (from PyCharm 5.0 only).

Some notable highlights of this update include:

  • a fix for hangs on opening context menus (PY-17113)
  • a fix for tool windows not being hidden automatically (IDEA-146684)
  • Python 3.5 support fixes (PY-17282)
  • a fix for wrong encodings (PY-17568)
  • a fix for code inspections performance problems (PY-17356)
  • a fix for Docstring support (PY-17470)
  • a fix in the debugger for Attach to Process (PY-17465)
  • a GAE support fix (PY-17473)
  • and more

For further details on the bug-fixes and changes, please consult the Release Notes.

As usual, please report any problems you found in our issue tracker.

If you would like to discuss your experience with PyCharm, we look forward to your feedback in the comments to this blog post and on twitter.

Develop with Pleasure!
-PyCharm team

Posted in Release Announcements, Uncategorized | 8 Comments

Announcing Educational Plugin for PyCharm 5

Hello everyone,

Did you see the release announcement of the brand-new PyCharm 5 yesterday? Big release indeed. And today we have more amazing news for everyone who’s passionate about learning and teaching programming with Python: We’ve released Educational plugin for PyCharm 5.

This plugin brings educational functionality to PyCharm similar to what we have in PyCharm Edu. That means you can go through interactive programming courses with Python using a real professional development environment, and easily switch to professional Python, Django or Scientific projects afterwards.

In releasing this separate plugin, we aim to provide flexibility. PyCharm Edu remains as the best free, easy and professional tool for learning and teaching programming with Python. All new educational features and improvements will go to PyCharm Edu first.

So what should you choose if you want to learn programming with Python?

  • PyCharm Edu is the better option if you’re new to programming and to Python itself. It’s free and open source, it has a clean and simple UI, and is free of features you don’t need as you take your first steps in learning programming. Nevertheless, you start programming with a real Python IDE that can smoothen your transition to the full-featured PyCharm.
  • PyCharm Professional Edition is the better choice if you’ve got experience with pure Python programming and want to dive deeper, for example to learn Django or other web frameworks, use databases, version control systems, a full-featured debugger, remote development functionality, etc. Install the Educational plugin additionally to make use of interactive programming courses and integrations with learning management systems.

As usual, the plugin can be installed from the plugin manager inside PyCharm 5 (Settings | Plugins).

Note: Educational plugin works only with PyCharm 5 Professional or Community editions.

Follow these instructions to set up the plugin:

  • Download PyCharm 5 (the plugin works with both Professional and Community editions).
  • Install it and go to Settings (Preferences for Mac OS users) | Plugins.
  • Click the ‘Install JetBrains plugin’ button and find ‘Educational Plugin for PyCharm’:eduplugin1
  • Click the install button and proceed with the installation.
  • Restart PyCharm.
  • Follow this online tutorial to create an educational project and start going through an interactive course.

Teachers, instructors and course authors can now create interactive courses with support for all the features that PyCharm Professional Edition provides, such as an interactive Django course. To create your course using PyCharm 5, install the separate ‘Course Creator for PyCharm’ plugin:


After the installation is complete, please follow the Getting Started for Educators tutorial to learn how to create an interactive course.

Please take the plugin for a spin, discover how the whole concept works, and if you run into any problems with the plugins, please don’t hesitate to report them to the issue tracker.

Develop with Pleasure,
JetBrains Team

Posted in Cool Feature | 2 Comments

Announcing General Availability of PyCharm 5

Hurray, we’ve just released PyCharm 5, the new major version of our intelligent IDE for Python, web and scientific development! It is one of the updates of our desktop products that comprise the brand new JetBrains Toolbox.


Download PyCharm 5 for your platform today!

PyCharm 5 is available as a full-fledged Professional Edition for Python and Web development, or as a free and open-source Community Edition for pure Python and scientific development.

PyCharm 5 brings an outstanding lineup of new features, including full Python 3.5 support, Docker integration, Thread Concurrency Visualization, code insight for Django ORM methods, Conda integration, and IPython Notebook v4 support, just to name a few.

The highlights of this version include:

Python-related improvements:

  • Full Python 3.5 support
  • Docker integration
  • Thread Concurrency Visualization
  • Better code insight for Django ORM methods
  • Google and NumPy Style Python docstrings
  • Conda integration
  • App Config Tool for Google App Engine projects
  • And more

IDE enhancements:

  • Brand-new indication for running configurations
  • Find in Path with instant preview
  • New UI for testing and tests history
  • Updated database tools
  • Editing code in diff viewer
  • Branch operations from VCS Log Viewer and the new “Rebase” action for git

PyCharm 5 Professional Edition also brings a lot of web development enhancements including:

  • Improved ReactJS support
  • TypeScript 1.6 support
  • Support for AngularJS 2.0
  • Better support for Meteor
  • Dart support enhancements
  • And much more

Please see What’s New in PyCharm 5 for more details, or watch this short What’s New in PyCharm 5 video:

Download PyCharm 5 for your platform here!

PyCharm 5 Professional Edition is a free update for you if purchased your license after November 2, 2014. As usual, a 30-day trial is available if you want to try PyCharm Professional Edition as your new Python IDE.

Develop with pleasure!
JetBrains PyCharm Team

Posted in Release Announcements, Video | 28 Comments

PyCharm 5 RC2 is available

With just a few days before the official release of PyCharm 5, today we’ve published the PyCharm 5 RC2 build, which is already available for download and evaluation from the EAP page.

The full list of fixes and improvements for this build can be found in the release notes.

Download PyСharm 5 RC2 build for your platform and please report any bugs and feature request to our Issue Tracker. It also will be available shortly as a patch update from within the IDE (from previous EAP builds only) for those who selected the EAP or Beta Releases channels in the update settings.

Stay tuned for a PyCharm 5 release announcement, follow us on twitter, and develop with pleasure!

-PyCharm Team

Posted in Early Access Preview | 1 Comment

PyCharm 5 Release Candidate is available

We are now approaching the final steps towards the PyCharm 5 release. So today we’ve published the PyCharm 5 Release Candidate.

The PyCharm 5 RC build 143.526 is available for download from the Early Access Preview page. Please take it for a spin and give us your feedback.

PyCharm 5 Release Candidate includes mostly a consolidation of bug fixes as compared to the previous PyCharm 5 Beta build. For the detailed list of notable changes and improvements in this build, please check the Release Notes.

In case you missed what’s new in upcoming PyCharm 5 – please see the announcement of PyCharm 5 Beta or for detailed information, check the announcements of previous EAP builds.

You can download the build or upgrade from within the IDE (from previous PyCharm 5 EAP builds only) without a full re-installation using the patch-based upgrade. Just make sure you’ve selected the EAP or Beta Releases channel in the update settings.

We hope that there will be no major bugs, however, should you encounter any problems, please report them to YouTrack – we’ll still have a bit of time to fix stuff before the final release.

Stay tuned for a PyCharm 5 release announcement, follow us on twitter, and develop with pleasure!

-PyCharm team

Posted in Early Access Preview | Leave a comment

Announcing PyCharm Edu 2.0.2: CheckiO integration

Today we have great news for everyone passionate about learning and teaching programming with Python.

First, we’ve released PyCharm Edu 2.0.2, an updated version of our free, easy and professional tool for learning programming with Python. This release consolidates many bug fixes and small improvements in different subsystems. Download PyCharm Edu 2.0.2 for your platform today!

Second, and it’s going to be the top story of this blog post: we announce the CheckiO plugin for PyCharm Edu.


CheckiO is a programming learning platform and a gamified website that teaches problem solving with Python. Its aim is to offer a safe environment to learn writing better code, for beginners and advanced programmers alike. Organized in a game format, CheckIO is very appealing to novice programmers, especially kids, who don’t have any previous coding experience and need to be engaged in the game process.

With CheckiO, programmers can take on missions such as computing the median value, to understand how to use Python and apply programming theory to solve real world problems. Read more and sign up on the CheckiO official website.

The CheckiO plugin is the first plugin for PyCharm Edu. Detailed information is available on the official plugin website. By using this plugin, you can combine the easy learning curve of CheckiO with the power of a real-world professional tool for Python programming. Learning programming with PyCharm Edu prepares you to smoothly advance to other professional development tools such as PyCharm Professional Edition, IntelliJ IDEA, and others.

To get started:
1. Download PyCharm Edu 2.0.2 for your platform and install it.

2. Download CheckiO plugin for PyCharm Edu from the official JetBrains repository.

Note: The CheckiO plugin requires Oracle Java 8. Please make sure the appropriate Java 8 is installed on your platform. This plugin works only with PyCharm Edu 2.0.2.

3. In PyCharm Edu, go to Settings (Preferences for Mac OS users) | Plugins and click the “Install plugin from disk” button.

4. In the opening dialog choose the downloaded file and click ok.

5. Click ‘Restart PyCharm Edu’ in the same Plugins dialog:


6. Go to File | New Project. Select the CheckiO project type, give it a name and select the Python interpreter for this project as shown on the screenshot, and then click “Create”:


7. PyCharm will open the CheckiO website and ask you to log in. After a successful login, the PyCharm Edu plugin will appear as authorized on the website.

8. Return to PyCharm to see something like this:


You can now perform CheckiO missions right inside PyCharm Edu and enjoy its assistance in solving various programming problems.

On the left-hand side you can see the Project View with a few stations (lessons) and missions (tasks) inside.

On the right-hand side there is a Task info window with the mission description and special buttons. You can submit your solution for checking, navigate to previous / next mission, reset your solution to the initial state, check hints for the mission, update the entire project, and view existing solutions from other CheckiO players:


Use the editor to complete a mission. Once you’re ready to check your solution, click the ‘Run and Check’ button as shown below:


After successfully finishing a mission you are congratulated with “Task solved!” in the Task info, and the mission is marked as completed in the project view:


Continue to the next mission by using navigational buttons or choosing another mission in the project view.

In the bottom right-hand corner you may notice the “User Info” pane. Click it to see your progress:


Enjoy playing with CheckiO and PyCharm Edu, solving real world problems and learning!

Develop with Pleasure!
JetBrains PyCharm Team

Posted in Cool Feature, Release Announcements | 11 Comments