A generic version of typing.TypedDict.
This would allow for people to make there own typed Mappings, it would desugar to a series of overloads on __getitem__ and get
class MyMapping(MultiDict, TypedMapping):
foo: int| import { EventPublisher } from "@orpc/client"; | |
| import { sign_in } from "@packages/db/interfaces"; | |
| import { createFileRoute, useNavigate } from "@tanstack/react-router"; | |
| // import { use, useEffect } from "react"; | |
| import z from "zod"; | |
| import { InitialiseStep, UCardNumber } from "@/api/locations/$name/sign-in/_flows/_steps"; // TODO double check if this actually problematically not shaken | |
| import type { | |
| Finalise as _Finalise, | |
| Initialise as _Initialise, | |
| Receive as _Receive, |
| import { deskOrAdmin, transaction } from "@/router"; | |
| import { exhaustiveGuard } from "@/utils/base"; | |
| import { ensureUser } from "@/utils/sign-in"; | |
| import e from "@db/edgeql-js"; | |
| import { eventIterator } from "@orpc/server"; | |
| import { z } from "zod/v4"; | |
| import { BaseInputStep, SignInErrors, SignInStepInput, type SignInStepOutput } from "./_flows/_types"; | |
| import agreements from "./_flows/agreements"; | |
| import cancel from "./_flows/cancel"; | |
| import finalise from "./_flows/finalise"; |
| import { ValidationPipe, VersioningType } from '@nestjs/common'; | |
| import { NestFactory } from '@nestjs/core'; | |
| import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger'; | |
| import helmet from 'helmet'; | |
| import { AppModule } from './app.module'; | |
| import { AllExceptionsFilter } from './filters/all-exceptions/all-exceptions.filter'; | |
| import { ResponseFormatService } from './response-format/response-format.service'; | |
| async function bootstrap() { | |
| const app = await NestFactory.create(AppModule); |
| import asyncio | |
| from typing import TypeVar, Generic | |
| T = TypeVar("T") | |
| AnyMsg = TypeVar("AnyMsg", "Msg", "Msg2") | |
| class Msg(Generic[T]): | |
| body: T |
| from __future__ import annotations | |
| from typing import Any, Awaitable, Callable, TypeVar, cast, Generic | |
| import asyncio | |
| T = TypeVar("T", bound=int, covariant=True) | |
| B = TypeVar("B", bound="Box[Any]") | |
| class Box(Generic[T]): ... | |
| async def foo( | |
| check: Callable[[B], bool] | None = None, |
| async def request(self, method: str, url: Union[APIRoute, CRoute, str], | |
| **kwargs) -> Optional[Any]: # adapted from d.py | |
| kwargs['headers'] = { | |
| "User-Agent": self.user_agent, | |
| **kwargs.get('headers', {}) | |
| } | |
| async with self._lock: | |
| for tries in range(5): | |
| async with self._session.request(method, str(url), **kwargs) as r: |
| # -*- coding: utf-8 -*- | |
| """ | |
| The MIT License (MIT) | |
| Copyright (c) 2015-2020 Rapptz | |
| Copyright (c) 2015 Rossen Georgiev <[email protected]> | |
| Permission is hereby granted, free of charge, to any person obtaining a copy of | |
| this software and associated documentation files (the "Software"), to deal in |
| # Editors | |
| .vscode/ | |
| .idea/ | |
| # Mac/OSX | |
| .DS_Store | |
| # Windows | |
| Thumbs.db |
This is going to be a short-ish guide on sub-classing help as ?tag new help isn't great at explaining things.
HelpCommand unless you're going to override every one of the send_x methods, because that class does not do anything (it literally just returns None)DefaultHelpCommand is for the default help command (the code block one) 
MinimalHelpCommandis a minimalistic version of the help command, this is an example of the command produced if you copy ?tag new help
HelpCommand is a completely blank slate and can be subclassed to look any way you want, although most people use them for embeds ![My example of a help co