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 asyncio | |
import collections.abc | |
import inspect | |
import random | |
import typing | |
@typing.overload | |
def select[T]( | |
awaitables: collections.abc.Sequence[collections.abc.Awaitable[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
#![no_std] | |
use core::{ | |
cell::UnsafeCell, | |
mem::MaybeUninit, | |
sync::atomic::{AtomicU8, Ordering}, | |
task::Waker, | |
}; | |
const EMPTY: u8 = 0b000; |
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 example shows an implementation of the @oneOf directive proposed here: | |
https://github.com/graphql/graphql-spec/pull/825. | |
It requires Python 3.9 and graphql-core 3.1.3 (https://github.com/graphql-python/graphql-core). | |
Although the directive support can be implemented out of the box when used in a field | |
definition, its use in input object type definition requires a specific graphql-core | |
feature custom output types of input object types | |
(https://graphql-core-3.readthedocs.io/en/latest/diffs.html#custom-output-types-of-input-object-types). |