Python

Read the latest updates about all things Python at Microsoft

Idiomatic Python: EAFP versus LBYL

One idiomatic practice in Python that often surprises people coming from programming languages where exceptions are considered, well, exceptional, is EAFP: "it's easier to ask for forgiveness than permission". Quickly, EAFP means that you should just do what you expect to work and if an exception might be thrown from the operation then catch ...

Python and Django on Nano Server

This post is contributed by Refaat Issa from the Nano Server team, and was originally posted on their blog. Nano Server has also blogged about their support for MySQL and Node.js. One of Nano Server’s core scenarios is to serve as a lightweight OS for born-in-the-cloud applications running in a VM or a container. Nano Server already ...
Comments are closed.0 0

Python lambda expressions unleashed

Carl Kadie, Ph.D., is a research developer in Microsoft Research/TnR working on Genomics. (image) Lambda expressions provide a way to pass functionality into a function. Sadly, Python puts two annoying restrictions on lambda expressions. First, lambdas can only contain an expression, not statements. Second, lambdas can't be ...