24 Apr 2019

feedPlanet Python

Python Engineering at Microsoft: Python in Visual Studio Code – April 2019 Release

We are pleased to announce that the April 2019 release of the Python Extension for Visual Studio Code is now available. You can download the Python extension from the Marketplace, or install it directly from the extension gallery in Visual Studio Code. You can learn more about Python support in Visual Studio Code in the documentation.

In this release we made a series of improvements that are listed in our changelog, closing a total of 84 issues including:

Keep on reading to learn more!

Variable Explorer and Data Viewer

The Python Interactive experience now comes with a built-in variable explorer along with a data viewer, a highly requested feature from our users. Now you can easily view, inspect and filter the variables in your application, including lists, NumPy arrays, pandas data frames, and more!

A variables section will now be shown when running code and cells in the Python Interactive window. Once you expand it, you'll see the list of the variables in the current Jupyter session. More variables will show up automatically as they get used in the code. Clicking on each column header will sort the variables in the table.

You can also double-click on each row or use the "Show variable in data viewer" button to view full data of each variable in the newly-added Data Viewer, as well as perform simple search over its values:

The Data Viewer requires pandas package 0.20 or later, and you will get a message to install or upgrade if it's not available.

The Variable Explore is enabled by default. You can turn it off through File > Preferences > Settings and looking for the Python > Data Science: Show Jupyter Variable Explorer setting.

Enhancements to debug configuration

We simplified the process of configuring the debugger for your workspace. When you start debugging (through the Debug Panel, F5 or Debug > Start Debugging) and no debug configuration exists, you now will be prompted to create a debug configuration for your application. Creating a debug configuration is accomplished through a set of menus, instead of manually configuring the launch.json file.

This prompt will also be displayed when adding another debug configuration through the launch.json file:

Additional improvements to the Python Language Server

This release includes several fixes and improvements to the Python Language Server. We added back features that were removed in the 0.2 release: "Rename Symbol", "Go to Definition" and "Find All References", and made improvements to loading time and memory usage when importing scientific libraries such as pandas, Plotly, PyQt5 , especially when running in full Anaconda environments.

To opt-in to the Language Server, change the python.jediEnabled setting to false in File > Preferences > User Settings. We are working towards making the language server the default in the next few releases, so if you run into problems, please file an issue on the Python Language Server GitHub page.

Other Changes and Enhancements

We have also added small enhancements and fixed issues requested by users that should improve your experience working with Python in Visual Studio Code. Some notable changes include:

Be sure to download the Python extension for Visual Studio Code now to try out the above improvements. If you run into any problems, please file an issue on the Python VS Code GitHub page.

The post Python in Visual Studio Code - April 2019 Release appeared first on Python.

24 Apr 2019 12:41am GMT

23 Apr 2019

feedPlanet Python

PyCoder’s Weekly: Issue #365 (April 23, 2019)

#365 - APRIL 23, 2019
View in Browser »

The PyCoder’s Weekly Logo

Requests III: HTTP for Humans and Machines

Requests is getting a makeover slated for release in 2020: asyncio, HTTP/2, connection pooling, timeouts, Python 3.6+, and more.

Python Learning Paths

Step-by-Step Python learning paths and study plans for beginner, intermediate, and advanced Python developers.

Packaging Python Inside Your Organization

What do you do when your organization uses Python for in-house development and you can't (or don't want to) make everything Open Source? Where do you store and manage your code? How do you distribute your packages? Stefan lays out his approach in this detailed article.

Find a Python Job Through Vettery


Vettery specializes in developer roles and is completely free for job seekers. Interested? Submit your profile, and if accepted, you can receive interview requests directly from top companies seeking Python devs. Get started →
VETTERY sponsor

Flask vs Django: Choose Your Python Web Framework

What are the main differences between Django and Flask? What are their respective strengths and weaknesses? Read Damian's article to find out.

Make a Python GUI App for NASA's Image Search API

Learn how to build a Python GUI app for browsing the NASA image library from scratch using the wxPython toolkit.

Positional-Only Parameters for Python

Inside baseball about PEP 570.


Why Use Anaconda?


Suitable Tattoo for a Job Interview

Now that's some dedication!

Python Jobs

Senior Python Developer (Copenhagen, Denmark)

GameAnalytics Ltd.

Senior Python Engineer (Remote)

ReCharge Payments

Python Engineer in Healthcare (Burlington, MA)

Nuance Communications

Machine Learning and Data Science Developer (Austin, TX)

Protection Engineering Consultants LLC

More Python Jobs >>>

Articles & Tutorials

How to Work With a PDF in Python

In this step-by-step tutorial, you'll learn how to work with PDF files in Python. You'll see how to extract metadata from preexisting PDFs . You'll also learn how to merge, split, watermark, and rotate pages in PDFs using Python and PyPDF2.

The 10 Most Common Mistakes That Python Developers Make

A list of harmful patterns & pitfalls you can avoid in your own Python code. This is an older post but it still applies as of 2019. Worth a read!

Python Opportunities Come to You on Indeed Prime


Indeed prime is a hiring platform exclusively for tech talent like you. If you're accepted, we'll match you with companies and roles that line up with your skills, career goals and salary expectations. Apply for free today.
INDEED sponsor

Sending Emails With Python

In this course, you'll learn how to send emails using Python. Find out how to send plain-text and HTML messages, add files as attachments, and send personalized emails to multiple people. Later on you'll build a CSV-powered email sending script from scratch.

Getting Started With Google Coral's TPU USB Accelerator

Learn how to get started with your Google Coral TPU Accelerator on Raspberry Pi and Ubuntu. You'll then learn how to perform classification and object detection using Google Coral's USB Accelerator.

What Do Companies Expect From Python Devs in 2019?

"We took 300 job specs for Python developers, scraped from StackOverflow, AngelList, LinkedIn, and the websites of some fast-growing tech companies worldwide. From all these descriptions, we extracted the skills which were mentioned most frequently"
ANDREW STETSENKO • Shared by Andrew Stetsenko

Raspberry Pi for Computer Vision and Deep Learning

You can teach your Raspberry Pi to "see" using Computer Vision, Deep Learning, and OpenCV. Let Adrian Rosebrock show you how →

Comparison of Top Data Science Libraries for Python, R, and Scala

This is an infographic comparing commit frequency and other metrics for the most popular data science libraries in Python, R, and Scala.

Guide to the Python time Module

Learn how to use Python's time module to represent dates and times in your application, manage code execution, and measure performance.

Creating a Heatmap From Scratch in Python


Extending Mypy With Plugins

MYPY-LANG.BLOGSPOT.COM • Shared by Ricky White

Projects & Code

puppeteer: An Opinionated Way to Manage Ansible Projects


datatest: Tools for Test Driven Data-Wrangling and Data Validation

GITHUB.COM/SHAWNBROWN • Shared by Shawn Brown

markplates: Templated Line-Based File Inclusions in Markdown Texts


totext.py: Convert URL or RSS Feed to Plain Text


PySnooper: Never Use Print for Debugging Again


dephell: Python Project Management (Packages, Venvs, and More)


flipper-client: Simple but Powerful Feature Flagging Tool


inline_python: Write Python Inline in Your Rust Code



SciPy Japan 2019

April 23 to April 25, 2019

Python Sudeste 2019

April 26 to April 29, 2019

PythOnRio Meetup

April 27, 2019

PyDelhi User Group Meetup

April 27, 2019

Dominican Republic Python User Group

April 30, 2019

PyCon US 2019

May 1 to May 10, 2019

PyDays Vienna

May 3 to May 5, 2019

Happy Pythoning!
This was PyCoder's Weekly Issue #365.
View in Browser »


[ Subscribe to 🐍 PyCoder's Weekly 💌 - Get the best Python news, articles, and tutorials delivered to your inbox once a week >> Click here to learn more ]

23 Apr 2019 7:30pm GMT

Codementor: What do companies expect from Python devs in 2019?

What skills does a Python dev need in 2019? Here is what a data-driven research shows.

23 Apr 2019 3:13pm GMT

10 Nov 2011


OSDir.com - Java: Oracle Introduces New Java Specification Requests to Evolve Java Community Process

From the Yet Another dept.:

To further its commitment to the Java Community Process (JCP), Oracle has submitted the first of two Java Specification Requests (JSRs) to update and revitalize the JCP.

10 Nov 2011 6:01am GMT

OSDir.com - Java: No copied Java code or weapons of mass destruction found in Android

From the Fact Checking dept.:

ZDNET: Sometimes the sheer wrongness of what is posted on the web leaves us speechless. Especially when it's picked up and repeated as gospel by otherwise reputable sites like Engadget. "Google copied Oracle's Java code, pasted in a new license, and shipped it," they reported this morning.

Sorry, but that just isn't true.

10 Nov 2011 6:01am GMT

OSDir.com - Java: Java SE 7 Released

From the Grande dept.:

Oracle today announced the availability of Java Platform, Standard Edition 7 (Java SE 7), the first release of the Java platform under Oracle stewardship.

10 Nov 2011 6:01am GMT

28 Oct 2011

feedPlanet Ruby

O'Reilly Ruby: MacRuby: The Definitive Guide

Ruby and Cocoa on OS X, the iPhone, and the Device That Shall Not Be Named

28 Oct 2011 8:00pm GMT

14 Oct 2011

feedPlanet Ruby

Charles Oliver Nutter: Why Clojure Doesn't Need Invokedynamic (Unless You Want It to be More Awesome)

This was originally posted as a comment on @fogus's blog post "Why Clojure doesn't need invokedynamic, but it might be nice". I figured it's worth a top-level post here.

Ok, there's some good points here and a few misguided/misinformed positions. I'll try to cover everything.

First, I need to point out a key detail of invokedynamic that may have escaped notice: any case where you must bounce through a generic piece of code to do dispatch -- regardless of how fast that bounce may be -- prevents a whole slew of optimizations from happening. This might affect Java dispatch, if there's any argument-twiddling logic shared between call sites. It would definitely affect multimethods, which are using a hand-implemented PIC. Any case where there's intervening code between the call site and the target would benefit from invokedynamic, since invokedynamic could be used to plumb that logic and let it inline straight through. This is, indeed, the primary benefit of using invokedynamic: arbitrarily complex dispatch logic folds away allowing the dispatch to optimize as if it were direct.

Your point about inference in Java dispatch is a fair one...if Clojure is able to infer all cases, then there's no need to use invokedynamic at all. But unless Clojure is able to infer all cases, then you've got this little performance time bomb just waiting to happen. Tweak some code path and obscure the inference, and kablam, you're back on a slow reflective impl. Invokedynamic would provide a measure of consistency; the only unforeseen perf impact would be when the dispatch turns out to *actually* be polymorphic, in which case even a direct call wouldn't do much better.

For multimethods, the benefit should be clear: the MM selection logic would be mostly implemented using method handles and "leaf" logic, allowing hotspot to inline it everywhere it is used. That means for small-morphic MM call sites, all targets could potentially inline too. That's impossible without invokedynamic unless you generate every MM path immediately around the eventual call.

Now, on to defs and Var lookup. Depending on the cost of Var lookup, using a SwitchPoint-based invalidation plus invokedynamic could be a big win. In Java 7u2, SwitchPoint-based invalidation is essentially free until invalidated, and as you point out that's a rare case. There would essentially be *no* cost in indirecting through a var until that var changes...and then it would settle back into no cost until it changes again. Frequently-changing vars could gracefully degrade to a PIC.

It's also dangerous to understate the impact code size has on JVM optimization. The usual recommendation on the JVM is to move code into many small methods, possibly using call-through logic as in multimethods to reuse the same logic in many places. As I've mentioned, that defeats many optimizations, so the next approach is often to hand-inline logic everywhere it's used, to let the JVM have a more optimizable view of the system. But now we're stepping on our own feet...by adding more bytecode, we're almost certainly impacting the JVM's optimization and inlining budgets.

OpenJDK (and probably the other VMs too) has various limits on how far it will go to optimize code. A large number of these limits are based on the bytecoded size of the target methods. Methods that get too big won't inline, and sometimes won't compile. Methods that inline a lot of code might not get inlined into other methods. Methods that inline one path and eat up too much budget might push out more important calls later on. The only way around this is to reduce bytecode size, which is where invokedynamic comes in.

As of OpenJDK 7u2, MethodHandle logic is not included when calculating inlining budgets. In other words, if you push all the Java dispatch logic or multimethod dispatch logic or var lookup into mostly MethodHandles, you're getting that logic *for free*. That has had a tremendous impact on JRuby performance; I had previous versions of our compiler that did indeed infer static target methods from the interpreter, but they were often *slower* than call site caching solely because the code was considerably larger. With invokedynamic, a call is a call is a call, and the intervening plumbing is not counted against you.

Now, what about negative impacts to Clojure itself...

#0 is a red herring. JRuby supports Java 5, 6, and 7 with only a few hundred lines of changes in the compiler. Basically, the compiler has abstract interfaces for doing things like constant lookup, literal loading, and dispatch that we simply reimplement to use invokedynamic (extending the old non-indy logic for non-indified paths). In order to compile our uses of invokedynamic, we use Rémi Forax's JSR-292 backport, which includes a "mock" jar with all the invokedynamic APIs stubbed out. In our release, we just leave that library out, reflectively load the invokedynamic-based compiler impls, and we're off to the races.

#1 would be fair if the Oracle Java 7u2 early-access drops did not already include the optimizations that gave JRuby those awesome numbers. The biggest of those optimizations was making SwitchPoint free, but also important are the inlining discounting and MutableCallSite improvements. The perf you see for JRuby there can apply to any indirected behavior in Clojure, with the same perf benefits as of 7u2.

For #2, to address the apparent vagueness in my blog post...the big perf gain was largely from using SwitchPoint to invalidate constants rather than pinging a global serial number. Again, indirection folds away if you can shove it into MethodHandles. And it's pretty easy to do it.

#3 is just plain FUD. Oracle has committed to making invokedynamic work well for Java too. The current thinking is that "lambda", the support for closures in Java 7, will use invokedynamic under the covers to implement "function-like" constructs. Oracle has also committed to Nashorn, a fully invokedynamic-based JavaScript implementation, which has many of the same challenges as languages like Ruby or Python. I talked with Adam Messinger at Oracle, who explained to me that Oracle chose JavaScript in part because it's so far away from Java...as I put it (and he agreed) it's going to "keep Oracle honest" about optimizing for non-Java languages. Invokedynamic is driving the future of the JVM, and Oracle knows it all too well.

As for #4...well, all good things take a little effort :) I think the effort required is far lower than you suspect, though.

14 Oct 2011 2:40pm GMT

07 Oct 2011

feedPlanet Ruby

Ruby on Rails: Rails 3.1.1 has been released!

Hi everyone,

Rails 3.1.1 has been released. This release requires at least sass-rails 3.1.4










You can find an exhaustive list of changes on github. Along with the closed issues marked for v3.1.1.

Thanks to everyone!

07 Oct 2011 5:26pm GMT

21 Mar 2011

feedPlanet Perl

Perl NOC Log: Planet Perl is going dormant

Planet Perl is going dormant. This will be the last post there for a while.

image from planet.perl.org

Why? There are better ways to get your Perl blog fix these days.

You might enjoy some of the following:

Will Planet Perl awaken again in the future? It might! The universe is a big place, filled with interesting places, people and things. You never know what might happen, so keep your towel handy.

21 Mar 2011 2:04am GMT

Ricardo Signes: improving on my little wooden "miniatures"

A few years ago, I wrote about cheap wooden discs as D&D minis, and I've been using them ever since. They do a great job, and cost nearly nothing. For the most part, we've used a few for the PCs, marked with the characters' initials, and the rest for NPCs and enemies, usually marked with numbers.

With D&D 4E, we've tended to have combats with more and more varied enemies. (Minions are wonderful things.) Numbering has become insufficient. It's too hard to remember what numbers are what monster, and to keep initiative order separate from token numbers. In the past, I've colored a few tokens in with the red or green whiteboard markers, and that has been useful. So, this afternoon I found my old paints and painted six sets of five colors. (The black ones I'd already made with sharpies.)

D&D tokens: now in color

I'm not sure what I'll want next: either I'll want five more of each color or I'll want five more colors. More colors will require that I pick up some white paint, while more of those colors will only require that I re-match the secondary colors when mixing. I think I'll wait to see which I end up wanting during real combats.

These colored tokens should work together well with my previous post about using a whiteboard for combat overview. Like-type monsters will get one color, and will all get grouped to one slot on initiative. Last night, for example, the two halfling warriors were red and acted in the same initiative slot. The three halfling minions were unpainted, and acted in another, later slot. Only PCs get their own initiative.

I think that it did a good amount to speed up combat, and that's even when I totally forgot to bring the combat whiteboard (and the character sheets!) with me. Next time, we'll see how it works when it's all brought together.

21 Mar 2011 12:47am GMT

20 Mar 2011

feedPlanet Perl

Dave Cross: Perl Vogue T-Shirts

Is Plack the new Black?In Pisa I gave a lightning talk about Perl Vogue. People enjoyed it and for a while I thought that it might actually turn into a project.

I won't though. It would just take far too much effort. And, besides, a couple of people have pointed out to be that the real Vogue are rather protective of their brand.

So it's not going to happen, I'm afraid. But as a subtle reminder of the ideas behind Perl Vogue I've created some t-shirts containing the article titles from the talk. You can get them from my Spreadshirt shop.

20 Mar 2011 12:02pm GMT