DEV Community

потик
потик

Posted on

Weekly Dev Findings 8

Python

Python 3.12 release

  • Better error description
>>> sys.version_info
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'sys' is not defined. Did you forget to import 'sys'?
Enter fullscreen mode Exit fullscreen mode
  • A lot of typing improvements

Simple Generics

def max[T](args: Iterable[T]) -> T:
    ...

class list[T]:
    def append(self, element: T) -> None:
        ...
Enter fullscreen mode Exit fullscreen mode

Type declaration

type Point[T] = tuple[T, T]
Enter fullscreen mode Exit fullscreen mode

kwargs typing

from typing import TypedDict, Unpack

class Movie(TypedDict):
  name: str
  year: int

def foo(**kwargs: Unpack[Movie]): ...
Enter fullscreen mode Exit fullscreen mode

JavaScript

TypeScript 5.3 Beta

Switch narrowing:

function f(x: unknown) {
    switch (true) {
        case typeof x === "string":
            // 'x' is a 'string' here
            console.log(x.toUpperCase());
            // falls through...

        case Array.isArray(x):
            // 'x' is a 'string | any[]' here.
            console.log(x.length);
            // falls through...

        default:
          // 'x' is 'unknown' here.
          // ...
    }
}
Enter fullscreen mode Exit fullscreen mode

  • NativeScript (Vue Mobile framework) support in Apple Vision Pro


AI

  • AI Emojis - generate custom emojis with AI
  • open-interpreter - terminal app that turns prompts into running scripts
  • magentic - decorate python function with prompt, lib will implement it using LLM  
  • Make films from scratch using AI

  • Make web apps with simple logic from diagram photo

  • ollama - tool for running LLMs like Llama, has task oriented models like sqlcoder

Tools

  • codesnap - beutiful code snippets editor

Entertainment

amazing 3d visualization like in Matrix

Top comments (0)