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 { 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 <rossen@rgp.io> | |
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) MinimalHelpCommand
is 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 coThis 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) MinimalHelpCommand
is 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 com