This file contains hidden or 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 was a backup plan I had in mind if cimporting propcache from cython gets rejected | |
| My main reason behind trying to force it in CPython or Cython is actually to come up with a new library | |
| that deprecates property types (including cached properties) without needing to write | |
| @deprecated(reason="blah blah blah") | |
| @property | |
| It is easier said as | |
| @deprecated_property(reason="blah blah blah") |
This file contains hidden or 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 "api.h" | |
| #include <stdio.h> | |
| // Don't want to override llhttp's work now do we? | |
| #define H2_CALLBACK_MAYBE(PARSER, NAME) \ | |
| do { \ | |
| const llh2_settings_t *settings; \ | |
| settings = (const llh2_settings_t *)(PARSER)->settings; \ | |
| if (settings == NULL || settings->NAME == NULL) \ | |
| { \ |
This file contains hidden or 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
| # Currently this is a concept as the plan for aiohttp's http2 support | |
| # is still under some debate: | |
| # Author: Vizonex | |
| # Filename (If added): "aiohttp/http2_parser.py" | |
| from contextlib import suppress | |
| from enum import IntEnum | |
| from typing import ( | |
| Any, | |
| ClassVar, |
This file contains hidden or 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
| # Currently this is a concept as the plan for aiohttp's http2 support | |
| # is still under some debate: | |
| # Author: Vizonex | |
| # Filename (If added): "aiohttp/http2_writer.py" | |
| """Http related parsers and protocol.""" | |
| import asyncio | |
| import sys | |
| from typing import ( # noqa |
This file contains hidden or 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
| # Copyright (c) 2001-2006 Twisted Matrix Laboratories. | |
| # See LICENSE for details. | |
| """ | |
| Interface to epoll I/O event notification facility. | |
| """ | |
| # NOTE: The version of Pyrex you are using probably _does not work_ with | |
| # Python 2.5. If you need to recompile this file, _make sure you are using | |
| # a version of Pyrex which works with Python 2.5_. I am using 0.9.4.1 from |
This file contains hidden or 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 cpython.time cimport PyTime_t, PyTime_AsSecondsDouble | |
| from cpython.object cimport PyObject, PyTypeObject | |
| # After carefully observing socketmodule.h over from CPython and some | |
| # different versions of python I've determined it might be possible to | |
| # expose this data to the cython api by simply copying off socketmodule.h | |
| # NOTE: Some macros that could be utilized however were too dynamic to | |
| # be utilized here. However just getting the file descriptor object means a lot | |
| # and has potential of being utilized with libraries such as winloop/uvloop for |
This file contains hidden or 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
| // If Aiohttp's _http_writer were moved to C and utilized multidict's upcoming C-API it would behave something like this. | |
| // It's a little bit bigger than cython's version because more care is required to work with it but the higher control is well worth it. | |
| // - Vizonex | |
| // Maybe the next step might be to start looking at making everything threadsafe so that multiple threads could share different | |
| // http writers? | |
| #include <Python.h> | |
| #include <string.h> | |
| #include <stdint.h> |
This file contains hidden or 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
| """ | |
| Generates A Multidict Cython API from multidict_api.h | |
| by parsing the functions to generate the Cython API | |
| Automatically. | |
| """ | |
| from __future__ import annotations | |
| import argparse | |
| import os |
This file contains hidden or 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
| # Compiler script written for windows because of the following problems. | |
| # | |
| # 1. `make` is not well supported on windows | |
| # | |
| # 2. llhttp uses a `rm` command that doesn't | |
| # work on windows so we need to make a script | |
| # for dealing with that that. | |
| # | |
| # 3. Some users prefer to using virtual enviornments so finding a rational way for using them would be an | |
| # ideal solution |
This file contains hidden or 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
| # NOTE "Some of these had to be manually added since stubgen in mypy doesn't even know that some of these items even exist." - Vizonex | |
| # -- ExprNodes.pyi -- | |
| from Cython.Compiler import Builtin as Builtin, Future as Future, Naming as Naming, Nodes as Nodes, PyrexTypes as PyrexTypes, StringEncoding as StringEncoding, Symtab as Symtab, TypeSlots as TypeSlots | |
| from Cython import Utils as Utils | |
| from Cython.Debugging import print_call_chain as print_call_chain | |
| from Cython.Compiler.Annotate import AnnotationItem as AnnotationItem | |
| from Cython.Compiler.Builtin import basestring_type as basestring_type, bytearray_type as bytearray_type, bytes_type as bytes_type, dict_type as dict_type, list_type as list_type, set_type as set_type, slice_type as slice_type, str_type as str_type, tuple_type as tuple_type, type_type as type_type, unicode_type as unicode_type | |
| from Cython.Compiler.Code import TempitaUtilityCode as TempitaUtilityCode, UtilityCode as UtilityCode |