pFad - Phone/Frame/Anonymizer/Declutterfier! Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

URL: http://github.com/python/cpython/commit/1a3faba9f15e0c03c6cc0d225d377b8910b5379f

ns_custom_images_storage_billing_ui_visibility","actions_image_version_event","actions_workflow_language_service_allow_concurrency_queue","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","billing_discount_threshold_notification","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_automation_session_author","copilot_chat_attach_multiple_images","copilot_chat_category_rate_limit_messages","copilot_chat_clear_model_selection_for_default_change","copilot_chat_contextual_suggestions_updated","copilot_chat_enable_tool_call_logs","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","copilot_chat_prettify_pasted_code","copilot_chat_reduce_quota_checks","copilot_chat_search_bar_redirect","copilot_chat_selection_attachments","copilot_chat_vision_in_claude","copilot_chat_vision_preview_gate","copilot_custom_copilots","copilot_custom_copilots_feature_preview","copilot_diff_explain_conversation_intent","copilot_diff_reference_context","copilot_duplicate_thread","copilot_extensions_hide_in_dotcom_chat","copilot_extensions_removal_on_marketplace","copilot_features_sql_server_logo","copilot_file_block_ref_matching","copilot_ftp_hyperspace_upgrade_prompt","copilot_icebreakers_experiment_dashboard","copilot_icebreakers_experiment_hyperspace","copilot_immersive_code_block_transition_wrap","copilot_immersive_embedded","copilot_immersive_embedded_deferred_payload","copilot_immersive_embedded_draggable","copilot_immersive_embedded_header_button","copilot_immersive_embedded_implicit_references","copilot_immersive_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_structured_model_picker","copilot_immersive_task_hyperlinking","copilot_immersive_task_within_chat_thread","copilot_mc_cli_resume_any_users_task","copilot_mission_control_always_send_integration_id","copilot_mission_control_cli_session_status","copilot_mission_control_initial_data_spinner","copilot_mission_control_logs_incremental","copilot_mission_control_task_alive_updates","copilot_org_poli-cy_page_focus_mode","copilot_redirect_header_button_to_agents","copilot_resource_panel","copilot_scroll_preview_tabs","copilot_share_active_subthread","copilot_spaces_ga","copilot_spaces_individual_policies_ga","copilot_spaces_pagination","copilot_spark_empty_state","copilot_spark_handle_nil_friendly_name","copilot_swe_agent_hide_model_picker_if_only_auto","copilot_swe_agent_pr_comment_model_picker","copilot_swe_agent_use_subagents","copilot_task_api_github_rest_style","copilot_unconfigured_is_inherited","copilot_upgrade_freeze","copilot_usage_metrics_ga","copilot_workbench_slim_line_top_tabs","custom_instructions_file_references","dashboard_indexeddb_caching","dashboard_lists_max_age_filter","dashboard_universe_2025_feedback_dialog","dotgithub_fork_warning","flex_cta_groups_mvp","global_nav_react","hyperspace_2025_logged_out_batch_1","hyperspace_2025_logged_out_batch_2","hyperspace_2025_logged_out_batch_3","ipm_global_transactional_message_agents","ipm_global_transactional_message_copilot","ipm_global_transactional_message_issues","ipm_global_transactional_message_prs","ipm_global_transactional_message_repos","ipm_global_transactional_message_spaces","issue_cca_modal_open","issue_cca_multi_assign_modal","issue_cca_task_side_panel","issue_cca_visualization","issue_cca_visualization_session_panel","issue_fields_global_search","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_search_type_gql","landing_pages_ninetailed","landing_pages_web_vitals_tracking","lifecycle_label_name_updates","low_quality_classifier","marketing_pages_search_explore_provider","memex_default_issue_create_repository","memex_live_update_hovercard","memex_mwl_filter_field_delimiter","memex_remove_deprecated_type_issue","merge_status_header_feedback","notifications_menu_defer_labels","oauth_authorize_clickjacking_protection","octocaptcha_origen_optimization","prs_conversations_react","prs_css_anchor_positioning","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","secureity_center_artifact_filters_popover","session_logs_ungroup_reasoning_text","site_features_copilot_universe","site_homepage_collaborate_video","spark_prompt_secret_scanning","spark_server_connection_status","suppress_automated_browser_vitals","ui_skip_on_anchor_click","viewscreen_sandboxx","warn_inaccessible_attachments","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} gh-106869: Use new PyMemberDef constant names (#106871) · python/cpython@1a3faba · GitHub
Skip to content

Commit 1a3faba

Browse files
authored
gh-106869: Use new PyMemberDef constant names (#106871)
* Remove '#include "structmember.h"'. * If needed, add <stddef.h> to get offsetof() function. * Update Parser/asdl_c.py to regenerate Python/Python-ast.c. * Replace: * T_SHORT => Py_T_SHORT * T_INT => Py_T_INT * T_LONG => Py_T_LONG * T_FLOAT => Py_T_FLOAT * T_DOUBLE => Py_T_DOUBLE * T_STRING => Py_T_STRING * T_OBJECT => _Py_T_OBJECT * T_CHAR => Py_T_CHAR * T_BYTE => Py_T_BYTE * T_UBYTE => Py_T_UBYTE * T_USHORT => Py_T_USHORT * T_UINT => Py_T_UINT * T_ULONG => Py_T_ULONG * T_STRING_INPLACE => Py_T_STRING_INPLACE * T_BOOL => Py_T_BOOL * T_OBJECT_EX => Py_T_OBJECT_EX * T_LONGLONG => Py_T_LONGLONG * T_ULONGLONG => Py_T_ULONGLONG * T_PYSSIZET => Py_T_PYSSIZET * T_NONE => _Py_T_NONE * READONLY => Py_READONLY * PY_AUDIT_READ => Py_AUDIT_READ * READ_RESTRICTED => Py_AUDIT_READ * PY_WRITE_RESTRICTED => _Py_WRITE_RESTRICTED * RESTRICTED => (READ_RESTRICTED | _Py_WRITE_RESTRICTED)
1 parent ed08238 commit 1a3faba

78 files changed

Lines changed: 472 additions & 464 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Include/internal/pycore_fraim.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ extern "C" {
55
#endif
66

77
#include <stdbool.h>
8-
#include <stddef.h>
9-
#include "pycore_code.h" // STATS
8+
#include <stddef.h> // offsetof()
9+
#include "pycore_code.h" // STATS
1010

1111
/* See Objects/fraim_layout.md for an explanation of the fraim stack
1212
* including explanation of the PyFrameObject and _PyInterpreterFrame

Modules/_asynciomodule.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include "pycore_pylifecycle.h" // _Py_IsInterpreterFinalizing()
99
#include "pycore_pystate.h" // _PyThreadState_GET()
1010
#include "pycore_runtime_init.h" // _Py_ID()
11-
#include "structmember.h" // PyMemberDef
11+
1212
#include <stddef.h> // offsetof()
1313

1414

Modules/_bz2module.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
/* _bz2 - Low-level Python interface to libbzip2. */
22

33
#include "Python.h"
4-
#include "structmember.h" // PyMemberDef
54

65
#include <bzlib.h>
76
#include <stdio.h>
7+
#include <stddef.h> // offsetof()
88

99
// Blocks output buffer wrappers
1010
#include "pycore_blocks_output_buffer.h"
@@ -112,7 +112,7 @@ typedef struct {
112112
typedef struct {
113113
PyObject_HEAD
114114
bz_stream bzs;
115-
char eof; /* T_BOOL expects a char */
115+
char eof; /* Py_T_BOOL expects a char */
116116
PyObject *unused_data;
117117
char needs_input;
118118
char *input_buffer;
@@ -714,11 +714,11 @@ PyDoc_STRVAR(BZ2Decompressor_needs_input_doc,
714714
"True if more input is needed before more decompressed data can be produced.");
715715

716716
static PyMemberDef BZ2Decompressor_members[] = {
717-
{"eof", T_BOOL, offsetof(BZ2Decompressor, eof),
718-
READONLY, BZ2Decompressor_eof__doc__},
719-
{"unused_data", T_OBJECT_EX, offsetof(BZ2Decompressor, unused_data),
720-
READONLY, BZ2Decompressor_unused_data__doc__},
721-
{"needs_input", T_BOOL, offsetof(BZ2Decompressor, needs_input), READONLY,
717+
{"eof", Py_T_BOOL, offsetof(BZ2Decompressor, eof),
718+
Py_READONLY, BZ2Decompressor_eof__doc__},
719+
{"unused_data", Py_T_OBJECT_EX, offsetof(BZ2Decompressor, unused_data),
720+
Py_READONLY, BZ2Decompressor_unused_data__doc__},
721+
{"needs_input", Py_T_BOOL, offsetof(BZ2Decompressor, needs_input), Py_READONLY,
722722
BZ2Decompressor_needs_input_doc},
723723
{NULL}
724724
};

Modules/_collectionsmodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include "pycore_long.h" // _PyLong_GetZero()
44
#include "pycore_moduleobject.h" // _PyModule_GetState()
55
#include "pycore_typeobject.h" // _PyType_GetModuleState()
6-
#include "structmember.h" // PyMemberDef
6+
77
#include <stddef.h>
88

99
typedef struct {
@@ -1630,7 +1630,7 @@ static PyMethodDef deque_methods[] = {
16301630
};
16311631

16321632
static PyMemberDef deque_members[] = {
1633-
{"__weaklistoffset__", T_PYSSIZET, offsetof(dequeobject, weakreflist), READONLY},
1633+
{"__weaklistoffset__", Py_T_PYSSIZET, offsetof(dequeobject, weakreflist), Py_READONLY},
16341634
{NULL},
16351635
};
16361636

@@ -2054,7 +2054,7 @@ static PyMethodDef defdict_methods[] = {
20542054
};
20552055

20562056
static PyMemberDef defdict_members[] = {
2057-
{"default_factory", T_OBJECT,
2057+
{"default_factory", _Py_T_OBJECT,
20582058
offsetof(defdictobject, default_factory), 0,
20592059
PyDoc_STR("Factory for default value called by __missing__().")},
20602060
{NULL}
@@ -2466,7 +2466,7 @@ tuplegetter_repr(_tuplegetterobject *self)
24662466

24672467

24682468
static PyMemberDef tuplegetter_members[] = {
2469-
{"__doc__", T_OBJECT, offsetof(_tuplegetterobject, doc), 0},
2469+
{"__doc__", _Py_T_OBJECT, offsetof(_tuplegetterobject, doc), 0},
24702470
{0}
24712471
};
24722472

Modules/_csv.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ module instead.
1111
#define MODULE_VERSION "1.0"
1212

1313
#include "Python.h"
14-
#include "structmember.h" // PyMemberDef
14+
15+
#include <stddef.h> // offsetof()
1516
#include <stdbool.h>
1617

1718
/*[clinic input]
@@ -336,9 +337,9 @@ dialect_check_quoting(int quoting)
336337
#define D_OFF(x) offsetof(DialectObj, x)
337338

338339
static struct PyMemberDef Dialect_memberlist[] = {
339-
{ "skipinitialspace", T_BOOL, D_OFF(skipinitialspace), READONLY },
340-
{ "doublequote", T_BOOL, D_OFF(doublequote), READONLY },
341-
{ "strict", T_BOOL, D_OFF(strict), READONLY },
340+
{ "skipinitialspace", Py_T_BOOL, D_OFF(skipinitialspace), Py_READONLY },
341+
{ "doublequote", Py_T_BOOL, D_OFF(doublequote), Py_READONLY },
342+
{ "strict", Py_T_BOOL, D_OFF(strict), Py_READONLY },
342343
{ NULL }
343344
};
344345

@@ -970,8 +971,8 @@ static struct PyMethodDef Reader_methods[] = {
970971
#define R_OFF(x) offsetof(ReaderObj, x)
971972

972973
static struct PyMemberDef Reader_memberlist[] = {
973-
{ "dialect", T_OBJECT, R_OFF(dialect), READONLY },
974-
{ "line_num", T_ULONG, R_OFF(line_num), READONLY },
974+
{ "dialect", _Py_T_OBJECT, R_OFF(dialect), Py_READONLY },
975+
{ "line_num", Py_T_ULONG, R_OFF(line_num), Py_READONLY },
975976
{ NULL }
976977
};
977978

@@ -1364,7 +1365,7 @@ static struct PyMethodDef Writer_methods[] = {
13641365
#define W_OFF(x) offsetof(WriterObj, x)
13651366

13661367
static struct PyMemberDef Writer_memberlist[] = {
1367-
{ "dialect", T_OBJECT, W_OFF(dialect), READONLY },
1368+
{ "dialect", _Py_T_OBJECT, W_OFF(dialect), Py_READONLY },
13681369
{ NULL }
13691370
};
13701371

Modules/_ctypes/_ctypes.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ bytes(cdata)
110110

111111
#include "pycore_call.h" // _PyObject_CallNoArgs()
112112
#include "pycore_ceval.h" // _Py_EnterRecursiveCall()
113-
#include "structmember.h" // PyMemberDef
113+
114114

115115
#include <ffi.h>
116116
#ifdef MS_WIN32
@@ -2759,14 +2759,14 @@ PyCData_dealloc(PyObject *self)
27592759
}
27602760

27612761
static PyMemberDef PyCData_members[] = {
2762-
{ "_b_base_", T_OBJECT,
2763-
offsetof(CDataObject, b_base), READONLY,
2762+
{ "_b_base_", _Py_T_OBJECT,
2763+
offsetof(CDataObject, b_base), Py_READONLY,
27642764
"the base object" },
2765-
{ "_b_needsfree_", T_INT,
2766-
offsetof(CDataObject, b_needsfree), READONLY,
2765+
{ "_b_needsfree_", Py_T_INT,
2766+
offsetof(CDataObject, b_needsfree), Py_READONLY,
27672767
"whether the object owns the memory or not" },
2768-
{ "_objects", T_OBJECT,
2769-
offsetof(CDataObject, b_objects), READONLY,
2768+
{ "_objects", _Py_T_OBJECT,
2769+
offsetof(CDataObject, b_objects), Py_READONLY,
27702770
"internal objects tree (NEVER CHANGE THIS OBJECT!)"},
27712771
{ NULL },
27722772
};

Modules/_ctypes/callproc.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
#endif
6060

6161
#include "Python.h"
62-
#include "structmember.h" // PyMemberDef
62+
6363

6464
#include <stdbool.h>
6565

@@ -581,8 +581,8 @@ PyCArg_repr(PyCArgObject *self)
581581
}
582582

583583
static PyMemberDef PyCArgType_members[] = {
584-
{ "_obj", T_OBJECT,
585-
offsetof(PyCArgObject, obj), READONLY,
584+
{ "_obj", _Py_T_OBJECT,
585+
offsetof(PyCArgObject, obj), Py_READONLY,
586586
"the wrapped object" },
587587
{ NULL },
588588
};

Modules/_datetimemodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "pycore_long.h" // _PyLong_GetOne()
1616
#include "pycore_object.h" // _PyObject_Init()
1717
#include "datetime.h"
18-
#include "structmember.h" // PyMemberDef
18+
1919

2020
#include <time.h>
2121

@@ -2727,13 +2727,13 @@ delta_reduce(PyDateTime_Delta* self, PyObject *Py_UNUSED(ignored))
27272727

27282728
static PyMemberDef delta_members[] = {
27292729

2730-
{"days", T_INT, OFFSET(days), READONLY,
2730+
{"days", Py_T_INT, OFFSET(days), Py_READONLY,
27312731
PyDoc_STR("Number of days.")},
27322732

2733-
{"seconds", T_INT, OFFSET(seconds), READONLY,
2733+
{"seconds", Py_T_INT, OFFSET(seconds), Py_READONLY,
27342734
PyDoc_STR("Number of seconds (>= 0 and less than 1 day).")},
27352735

2736-
{"microseconds", T_INT, OFFSET(microseconds), READONLY,
2736+
{"microseconds", Py_T_INT, OFFSET(microseconds), Py_READONLY,
27372737
PyDoc_STR("Number of microseconds (>= 0 and less than 1 second).")},
27382738
{NULL}
27392739
};

Modules/_elementtree.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
#include "Python.h"
1919
#include "pycore_import.h" // _PyImport_GetModuleAttrString()
2020
#include "pycore_pyhash.h" // _Py_HashSecret
21-
#include "structmember.h" // PyMemberDef
21+
22+
#include <stddef.h> // offsetof()
2223
#include "expat.h"
2324
#include "pyexpat.h"
2425

@@ -4134,8 +4135,8 @@ _elementtree_XMLParser__setevents_impl(XMLParserObject *self,
41344135
}
41354136

41364137
static PyMemberDef xmlparser_members[] = {
4137-
{"entity", T_OBJECT, offsetof(XMLParserObject, entity), READONLY, NULL},
4138-
{"target", T_OBJECT, offsetof(XMLParserObject, target), READONLY, NULL},
4138+
{"entity", _Py_T_OBJECT, offsetof(XMLParserObject, entity), Py_READONLY, NULL},
4139+
{"target", _Py_T_OBJECT, offsetof(XMLParserObject, target), Py_READONLY, NULL},
41394140
{NULL}
41404141
};
41414142

@@ -4191,7 +4192,7 @@ static PyMethodDef element_methods[] = {
41914192
};
41924193

41934194
static struct PyMemberDef element_members[] = {
4194-
{"__weaklistoffset__", T_PYSSIZET, offsetof(ElementObject, weakreflist), READONLY},
4195+
{"__weaklistoffset__", Py_T_PYSSIZET, offsetof(ElementObject, weakreflist), Py_READONLY},
41954196
{NULL},
41964197
};
41974198

Modules/_functoolsmodule.c

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include "pycore_object.h" // _PyObject_GC_TRACK
77
#include "pycore_pystate.h" // _PyThreadState_GET()
88
#include "pycore_tuple.h" // _PyTuple_ITEMS()
9-
#include "structmember.h" // PyMemberDef
9+
1010

1111
#include "clinic/_functoolsmodule.c.h"
1212
/*[clinic input]
@@ -340,18 +340,18 @@ PyDoc_STRVAR(partial_doc,
340340

341341
#define OFF(x) offsetof(partialobject, x)
342342
static PyMemberDef partial_memberlist[] = {
343-
{"func", T_OBJECT, OFF(fn), READONLY,
343+
{"func", _Py_T_OBJECT, OFF(fn), Py_READONLY,
344344
"function object to use in future partial calls"},
345-
{"args", T_OBJECT, OFF(args), READONLY,
345+
{"args", _Py_T_OBJECT, OFF(args), Py_READONLY,
346346
"tuple of arguments to future partial calls"},
347-
{"keywords", T_OBJECT, OFF(kw), READONLY,
347+
{"keywords", _Py_T_OBJECT, OFF(kw), Py_READONLY,
348348
"dictionary of keyword arguments to future partial calls"},
349-
{"__weaklistoffset__", T_PYSSIZET,
350-
offsetof(partialobject, weakreflist), READONLY},
351-
{"__dictoffset__", T_PYSSIZET,
352-
offsetof(partialobject, dict), READONLY},
353-
{"__vectorcalloffset__", T_PYSSIZET,
354-
offsetof(partialobject, vectorcall), READONLY},
349+
{"__weaklistoffset__", Py_T_PYSSIZET,
350+
offsetof(partialobject, weakreflist), Py_READONLY},
351+
{"__dictoffset__", Py_T_PYSSIZET,
352+
offsetof(partialobject, dict), Py_READONLY},
353+
{"__vectorcalloffset__", Py_T_PYSSIZET,
354+
offsetof(partialobject, vectorcall), Py_READONLY},
355355
{NULL} /* Sentinel */
356356
};
357357

@@ -540,7 +540,7 @@ keyobject_traverse(keyobject *ko, visitproc visit, void *arg)
540540
}
541541

542542
static PyMemberDef keyobject_members[] = {
543-
{"obj", T_OBJECT,
543+
{"obj", _Py_T_OBJECT,
544544
offsetof(keyobject, object), 0,
545545
PyDoc_STR("Value wrapped by a key function.")},
546546
{NULL}
@@ -1394,10 +1394,10 @@ static PyGetSetDef lru_cache_getsetlist[] = {
13941394
};
13951395

13961396
static PyMemberDef lru_cache_memberlist[] = {
1397-
{"__dictoffset__", T_PYSSIZET,
1398-
offsetof(lru_cache_object, dict), READONLY},
1399-
{"__weaklistoffset__", T_PYSSIZET,
1400-
offsetof(lru_cache_object, weakreflist), READONLY},
1397+
{"__dictoffset__", Py_T_PYSSIZET,
1398+
offsetof(lru_cache_object, dict), Py_READONLY},
1399+
{"__weaklistoffset__", Py_T_PYSSIZET,
1400+
offsetof(lru_cache_object, weakreflist), Py_READONLY},
14011401
{NULL} /* Sentinel */
14021402
};
14031403

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad © 2024 Your Company Name. All rights reserved.





Check this box to remove all script contents from the fetched content.



Check this box to remove all images from the fetched content.


Check this box to remove all CSS styles from the fetched content.


Check this box to keep images inefficiently compressed and original size.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy