$ pyright mycode_test.py
pyright 1.1.261
./mycode_test.py
./mycode_test.py:42:16 - error: Cannot assign member "slow_method" for type "Gizmo"
Expression of type "() -> Literal[3]" cannot be assigned to member "slow_method" of class "Gizmo"
Type "() -> Literal[3]" cannot be assigned to type "() -> Frob"
Function return type "Literal[3]" is incompatible with type "Frob"
"Literal[3]" is incompatible with "Frob" (reportGeneralTypeIssues)
1 error, 0 warnings, 0 informations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env python3 | |
# -*- coding: utf-8 -*- | |
import json | |
import os | |
import subprocess | |
import time | |
DD_API_BASE = "https://api.datadoghq.com" | |
DEFAULT_DATADOG_API_KEY = "f964b6d704a81c65acad65ba5c554c9d" | |
DATADOG_API_KEY = os.getenv("DATADOG_API_KEY") or os.getenv("DD_API_KEY") or DEFAULT_DATADOG_API_KEY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# This file echoes a bunch of color codes to the | |
# terminal to demonstrate what's available. Each | |
# line is the color code of one forground color, | |
# out of 17 (default + 16 escapes), followed by a | |
# test use of that color on all nine background | |
# colors (default + 8 escapes). | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Define a 'cap1fd' pytest fixture which captures stdout/stderr combined.""" | |
from __future__ import annotations | |
import contextlib | |
from io import FileIO | |
# from typing import ContextManager | |
from typing import Generator | |
from typing import NamedTuple | |
from typing import Self |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ # stealing the command used for is_closed | |
$ gh pr view https://github.com/getsentry/tacos-gha/pull/77 --json state | |
{ | |
"state": "OPEN" | |
} | |
$ gh pr view https://github.com/getsentry/tacos-gha/pull/77 --json | |
Specify one or more comma-separated fields for `--json`: | |
additions | |
assignees |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""this test passes if you let it run, but fails assert_pwd if you ctrl-c""" | |
from __future__ import annotations | |
import contextlib | |
import typing | |
from os import chdir, environ, getcwd | |
from pathlib import Path | |
from time import sleep | |
from pytest import fixture |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> i = 0x12000 | |
>>> while True: | |
... i, c, name = i + 1, chr(i), unicodedata.name(chr(i)) | |
... print(i, c, name) | |
... | |
73729 𒀀 CUNEIFORM SIGN A | |
73730 𒀁 CUNEIFORM SIGN A TIMES A | |
73731 𒀂 CUNEIFORM SIGN A TIMES BAD | |
73732 𒀃 CUNEIFORM SIGN A TIMES GAN2 TENU | |
73733 𒀄 CUNEIFORM SIGN A TIMES HA |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cd "$(mktemp -d)" | |
$ ln -sf realpath symlink | |
$ mkdir realpath | |
$ cd symlink | |
$ touch foo.py |
This kinda-sorta works:
$ cd share/Formality/
$ git diff
diff --git a/javascript/FormalityToJS.js b/javascript/FormalityToJS.js
index c2dc6a1..2089d39 100644
--- a/javascript/FormalityToJS.js
+++ b/javascript/FormalityToJS.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat.IO.readline<A: Type>(_: A): IO(String) | |
use line = IO.ask<String>("get_line", "") | |
IO.end<String>(line) | |
cat.go<A: Type>(io: IO(A)): IO(Unit) | |
get bind pure = IO.monad | |
let io1 = bind<,>(io, cat.IO.readline<>) | |
let io2 = bind<,>(io1, IO.print) | |
cat.go<>(io2) |