Formatted string literals are prefixed with 'f' and are similar to the format strings accepted by str.format(). They contain replacement fields surrounded by curly braces. The replacement fields are expressions, which are evaluated at run time, and then formatted using the format() protocol:
f"He said his name is {name}."
'He said his name is Fred.'
PEP 526 adds syntax to Python for annotating the types of variables including class variables and instance variables. Just as for function annotations, the Python interpreter does not attach any particular meaning to variable annotations and only stores them in the__annotations__ attribute of a class or module.
class Starship:
stats: Dict[str, int] = {}
Underscores in numeric literals for improved readability. For example: >>> >>> 1_000_000_000_000_000
A notable limitation of the Python 3.5 implementation is that it was not possible to use await and yield in the same function body. In Python 3.6 this restriction has been lifted, making it possible to define asynchronous generators.
support for using async for in list, set, dict comprehensions and generator expressions. Additionally, await expressions are supported in all kinds of comprehensions:
result = [i async for i in aiter() if i % 2]
result = [await fun() for fun in funcs if await condition()]
Racket is described as a “full-spectrum programming language” that goes beyond Lisp and Scheme with dialects that support objects, types and laziness.
When coding in it, you can link components written in different dialects, and write your own project-specific dialect if you want. The Racket libraries support applications from web servers and databases to GUIs, charts and now Android:
We covered the availability of the RC recently so there isn't much to add except that 2.1 is offically available. If you are a TypeScript user then Visual Studio should prompt you to upgrade.
The most important feature is Async functions which puts TypeScript a bit ahead of JavaScript which is only just aquireing them.
Some new features that we haven't covered in previous versions:
"We’ve been excited to deliver object rest & spread since its original proposal, and today it’s here in TypeScript 2.1. Object rest & spread is a new proposal for ES2017 that makes it much easier to partially copy, merge, and pick apart objects. The feature is already used quite a bit when using libraries like Redux."
keyof operator returns the keys uses in an object as a type
interface Person {
name: string;
age: number;
location: string;
}
let a: Person["age"];
Finally
Mapped Types allow you to change variable types of properties using something like a template:
type Booleanify<T> = { [P in keyof T]: boolean
};
type BooleanifiedPerson = Booleanify<Person>;
A novel investigation into the gender gap between men and women regarding coding ability was undertaken by Dr Siân Brooke. Her conclusion? There is a difference in the Python code [ ... ]
The clamour for safe programming languages seems to be growing and becoming official. We have known for a while that C and C++ are dangerous languages so why has it become such an issue now and is it [ ... ]