forked from python/cpython
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into issue-106176-_blocking_on-WeakValueDictionary
- Loading branch information
Showing
24 changed files
with
276 additions
and
123 deletions.
There are no files selected for viewing
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 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 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 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 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 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 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 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 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 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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* String Literals: _Py_Identifier API */ | ||
|
||
#ifndef Py_INTERNAL_IDENTIFIER_H | ||
#define Py_INTERNAL_IDENTIFIER_H | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#ifndef Py_BUILD_CORE | ||
# error "this header requires Py_BUILD_CORE define" | ||
#endif | ||
|
||
/* This structure helps managing static strings. The basic usage goes like this: | ||
Instead of doing | ||
r = PyObject_CallMethod(o, "foo", "args", ...); | ||
do | ||
_Py_IDENTIFIER(foo); | ||
... | ||
r = _PyObject_CallMethodId(o, &PyId_foo, "args", ...); | ||
PyId_foo is a static variable, either on block level or file level. On first | ||
usage, the string "foo" is interned, and the structures are linked. On interpreter | ||
shutdown, all strings are released. | ||
Alternatively, _Py_static_string allows choosing the variable name. | ||
_PyUnicode_FromId returns a borrowed reference to the interned string. | ||
_PyObject_{Get,Set,Has}AttrId are __getattr__ versions using _Py_Identifier*. | ||
*/ | ||
typedef struct _Py_Identifier { | ||
const char* string; | ||
// Index in PyInterpreterState.unicode.ids.array. It is process-wide | ||
// unique and must be initialized to -1. | ||
Py_ssize_t index; | ||
} _Py_Identifier; | ||
|
||
// For now we are keeping _Py_IDENTIFIER for continued use | ||
// in non-builtin extensions (and naughty PyPI modules). | ||
|
||
#define _Py_static_string_init(value) { .string = (value), .index = -1 } | ||
#define _Py_static_string(varname, value) static _Py_Identifier varname = _Py_static_string_init(value) | ||
#define _Py_IDENTIFIER(varname) _Py_static_string(PyId_##varname, #varname) | ||
|
||
extern PyObject* _PyType_LookupId(PyTypeObject *, _Py_Identifier *); | ||
extern PyObject* _PyObject_LookupSpecialId(PyObject *, _Py_Identifier *); | ||
extern PyObject* _PyObject_GetAttrId(PyObject *, _Py_Identifier *); | ||
extern int _PyObject_SetAttrId(PyObject *, _Py_Identifier *, PyObject *); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif // !Py_INTERNAL_IDENTIFIER_H |
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 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 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Label="ProjectConfigurations"> | ||
<ProjectConfiguration Include="Debug|ARM"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>ARM</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Debug|ARM64"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>ARM64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Debug|Win32"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Debug|x64"> | ||
<Configuration>Debug</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="PGInstrument|ARM"> | ||
<Configuration>PGInstrument</Configuration> | ||
<Platform>ARM</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="PGInstrument|ARM64"> | ||
<Configuration>PGInstrument</Configuration> | ||
<Platform>ARM64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="PGInstrument|Win32"> | ||
<Configuration>PGInstrument</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="PGInstrument|x64"> | ||
<Configuration>PGInstrument</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="PGUpdate|ARM"> | ||
<Configuration>PGUpdate</Configuration> | ||
<Platform>ARM</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="PGUpdate|ARM64"> | ||
<Configuration>PGUpdate</Configuration> | ||
<Platform>ARM64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="PGUpdate|Win32"> | ||
<Configuration>PGUpdate</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="PGUpdate|x64"> | ||
<Configuration>PGUpdate</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|ARM"> | ||
<Configuration>Release</Configuration> | ||
<Platform>ARM</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|ARM64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>ARM64</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|Win32"> | ||
<Configuration>Release</Configuration> | ||
<Platform>Win32</Platform> | ||
</ProjectConfiguration> | ||
<ProjectConfiguration Include="Release|x64"> | ||
<Configuration>Release</Configuration> | ||
<Platform>x64</Platform> | ||
</ProjectConfiguration> | ||
</ItemGroup> | ||
<PropertyGroup Label="Globals"> | ||
<ProjectGuid>{01FDF29A-40A1-46DF-84F5-85EBBD2A2410}</ProjectGuid> | ||
<RootNamespace>_testclinic_limited</RootNamespace> | ||
<Keyword>Win32Proj</Keyword> | ||
</PropertyGroup> | ||
<Import Project="python.props" /> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> | ||
<PropertyGroup Label="Configuration"> | ||
<ConfigurationType>DynamicLibrary</ConfigurationType> | ||
<CharacterSet>NotSet</CharacterSet> | ||
</PropertyGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> | ||
<PropertyGroup> | ||
<TargetExt>.pyd</TargetExt> | ||
</PropertyGroup> | ||
<ImportGroup Label="ExtensionSettings"> | ||
</ImportGroup> | ||
<ImportGroup Label="PropertySheets"> | ||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> | ||
<Import Project="pyproject.props" /> | ||
</ImportGroup> | ||
<PropertyGroup Label="UserMacros" /> | ||
<PropertyGroup> | ||
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<ClCompile Include="..\Modules\_testclinic_limited.c" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ResourceCompile Include="..\PC\python_nt.rc" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="pythoncore.vcxproj"> | ||
<Project>{cf7ac3d1-e2df-41d2-bea6-1e2556cdea26}</Project> | ||
<ReferenceOutputAssembly>false</ReferenceOutputAssembly> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> | ||
<ImportGroup Label="ExtensionTargets"> | ||
</ImportGroup> | ||
</Project> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup> | ||
<Filter Include="Source Files"> | ||
<UniqueIdentifier>{2422278e-eeeb-4241-8182-433e2bc5a7fc}</UniqueIdentifier> | ||
</Filter> | ||
<Filter Include="Resource Files"> | ||
<UniqueIdentifier>{41f1cd52-b682-46aa-a7fd-7bdf81a18010}</UniqueIdentifier> | ||
</Filter> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ClCompile Include="..\Modules\_testclinic_limited.c"> | ||
<Filter>Source Files</Filter> | ||
</ClCompile> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ResourceCompile Include="..\PC\python_nt.rc"> | ||
<Filter>Resource Files</Filter> | ||
</ResourceCompile> | ||
</ItemGroup> | ||
</Project> |
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
Oops, something went wrong.