//No Comment - Python 3.6, Racket v6.7 & TypeScript 2.1
Friday, 09 December 2016

• What’s New In Python 3.6 

• Racket v6.7

• Announcing TypeScript 2.1

nocomment

Sometimes the news is reported well enough elsewhere and we have little to add other than to bring it to your attention.

No Comment is a format where we present original source information, lightly edited, so that you can decide if you want to follow it up. 

 

 

 

What’s New In Python 3.6

  • 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()]

And of course a lot os smaller improvments.

racketbanner

Racket v6.7

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:

 

  • Racket supports building graphical applications on Android through the racket-android project: https://github.com/jeapostrophe/racket-android

  • The Racket REPL comes with line-editing, command and result history, and various meta-commands out of the box, via the racket/interactive module. 

  • The package system supports authentication when installing packages from git, using the raco pkg config git-checkout-credentials configuration option.

  • HTTP libraries, as well as raco pkg, support proxying via HTTP CONNECT.

  • Typed Racket provides typed versions of racket/os and racket/db/sqlite

 

typescriptlogo

Announcing TypeScript 2.1

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>;

 

 

nocommentlanguages

nocomment

 

To be informed about new articles on I Programmer, sign up for our weekly newsletter,subscribe to the RSS feed and follow us on, Twitter, FacebookGoogle+ or Linkedin.

Banner


pg_parquet - Postgres To Parquet Interoperability
28/11/2024

pg_parquet is a new extension by Crunchy Data that allows a PostgreSQL instance to work with Parquet files. With pg_duckdb, pg_analytics and pg_mooncake all of which can access Parquet files, is  [ ... ]



Zitadel Announces Funding And Future Plans
21/11/2024

Zitadel has announced a major funding round that will be used to expand technical teams and fund further product development. The company is the creator of an open source project for cloud-native iden [ ... ]


More News

espbook

 

Comments




or email your comment to: comments@i-programmer.info

 

Last Updated ( Friday, 09 December 2016 )