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
#include <stdio.h> | |
#include <stdlib.h> | |
#define ITERATOR_IMPL(T, state_t) \ | |
struct \ | |
{ \ | |
T (*__next__)(state_t *); \ | |
} | |
#define ITERATOR_STATE(T) \ | |
struct iterator_state_##T \ |
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
""" | |
My configuration file for ptpython. | |
Want it for yourself? Put it inside `<XDG home dir>/.config/ptpython/`. | |
""" | |
## LINT COMMAND ####################################################################### | |
# ruff check ~/.config/ptpython/config.py --select ALL --ignore D212,D203,INP001,D202 # | |
####################################################################################### |
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
import math | |
import sys | |
CORRECTOR = ((4 - sys.float_info.max * sys.float_info.min) / 2.5) | |
def fix_float(value: float) -> float: | |
if abs(value) < sys.float_info.epsilon: | |
return 0.0 |
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
{ | |
/* GLOBAL VS CODE SETTINGS */ | |
"window.titleBarStyle": "custom", | |
"editor.tabSize": 4, | |
"editor.stickyScroll.enabled": true, | |
"editor.lineNumbers": "on", | |
"editor.tabCompletion": "on", | |
"editor.formatOnSave": true, | |
"editor.suggestSelection": "first", | |
"editor.unicodeHighlight.allowedCharacters": { |
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
#!/usr/bin/env python | |
# pyright: reportUnusedCallResult = false | |
# Requires outspin: | |
# pip install outspin | |
from __future__ import annotations | |
import io | |
import os |
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
import ctypes | |
import dataclasses | |
import faulthandler | |
import typing | |
@dataclasses.dataclass(slots=True, repr=False) | |
class Human: | |
name: str | |
age: int = 0 |
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
@status DRAFT | |
@version | |
MAJOR 1 | |
MINOR 0 | |
REV 5 | |
all specifiers produce an escape sequence. | |
DEFINITIONS | |
• Tag: text surrounded by brackets that signal the start of a formatted |
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
import argparse | |
import asyncio | |
import os | |
import sys | |
import typing | |
class APrintNamespace(typing.Protocol): | |
message: str | |
tasks: int |
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
#!/usr/bin/env python3 | |
# pyright: reportUnusedCallResult = false, reportUnusedImport = false | |
# ruff: noqa: ANN101, D105, D107, D202, D205, D212, D401, DTZ005, EM101, S311, T201, TRY003 | |
""" | |
.pythonrc is a file which is executed when the Python interactive shell is | |
started if $PYTHONSTARTUP is in your environment and points to this file. It's | |
just regular Python code, so do what you will. Your ~/.inputrc file can | |
greatly complement this file. |
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
from __future__ import annotations | |
import asyncio | |
import collections.abc | |
import io | |
import os | |
import random | |
import sys | |
import time | |
import typing |
NewerOlder