Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
class Point:
    def __init__(self, x, y):
        self.x, self.y = x, y
point = dict(x=1.2, y=3.4)
from collections import namedtuple
Point = namedtuple("Point", "x y")
from dataclasses import dataclass
@dataclass
class Point:
    x: float
    y: float
point = {'x': 1.2, 'y': 3.4}
type Point is
   record
      X : Float;
      Y : Float;
   end record;

New implementation...
< >
programming-idioms.org