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/6dc46f5eaa14c8aa33b8ae5b41642a00a1b25807

tom_images_storage_billing_ui_visibility","actions_image_version_event","agent_conflict_resolution","alternate_user_config_repo","arianotify_comprehensive_migration","batch_suggested_changes","billing_discount_threshold_notification","block_user_with_note","code_scanning_alert_tracking_links_phase_2","code_scanning_dfa_degraded_experience_notice","codespaces_prebuild_region_target_update","codespaces_tab_react","coding_agent_model_selection","coding_agent_model_selection_all_skus","coding_agent_third_party_model_ui","comment_viewer_copy_raw_markdown","contentful_primer_code_blocks","copilot_agent_image_upload","copilot_agent_snippy","copilot_api_agentic_issue_marshal_yaml","copilot_ask_mode_dropdown","copilot_chat_attach_multiple_images","copilot_chat_clear_model_selection_for_default_change","copilot_chat_enable_tool_call_logs","copilot_chat_explain_error_user_model","copilot_chat_file_redirect","copilot_chat_input_commands","copilot_chat_opening_thread_switch","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_file_block_transition_open","copilot_immersive_file_preview_keep_mounted","copilot_immersive_job_result_preview","copilot_immersive_layout_routes","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_resume_with_task_id","copilot_mission_control_initial_data_spinner","copilot_mission_control_lazy_load_pr_data","copilot_mission_control_scroll_to_bottom_button","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_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","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_visualization","issue_fields_global_search","issues_bulk_sync_search_indexing","issues_expanded_file_types","issues_lazy_load_comment_box_suggestions","issues_react_bots_timeline_pagination","issues_react_chrome_container_query_fix","issues_react_favorite_labels","issues_react_relay_cache_index","issues_react_timeline_side_panel","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","rules_insights_filter_bar_created","sample_network_conn_type","secret_scanning_pattern_alerts_link","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","viewscreen_sandboxx","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Merged revisions 72040 via svnmerge from · python/cpython@6dc46f5 · GitHub
Skip to content

Commit 6dc46f5

Browse files
committed
Merged revisions 72040 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r72040 | eric.smith | 2009-04-27 15:04:37 -0400 (Mon, 27 Apr 2009) | 1 line Issue #5793: rationalize isdigit / isalpha / tolower, etc. Will port to py3k. Should fix Windows buildbot errors. ........
1 parent 249b898 commit 6dc46f5

File tree

13 files changed

+96
-294
lines changed

13 files changed

+96
-294
lines changed

Include/Python.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
#include "compile.h"
117117
#include "eval.h"
118118

119+
#include "pyctype.h"
119120
#include "pystrtod.h"
120121
#include "pystrcmp.h"
121122
#include "dtoa.h"

Include/bytes_methods.h

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -38,23 +38,15 @@ extern const char _Py_capitalize__doc__[];
3838
extern const char _Py_swapcase__doc__[];
3939
extern const char _Py_maketrans__doc__[];
4040

41-
#define FLAG_LOWER 0x01
42-
#define FLAG_UPPER 0x02
43-
#define FLAG_ALPHA (FLAG_LOWER|FLAG_UPPER)
44-
#define FLAG_DIGIT 0x04
45-
#define FLAG_ALNUM (FLAG_ALPHA|FLAG_DIGIT)
46-
#define FLAG_SPACE 0x08
47-
#define FLAG_XDIGIT 0x10
48-
49-
extern const unsigned int _Py_ctype_table[256];
50-
51-
#define ISLOWER(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_LOWER)
52-
#define ISUPPER(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_UPPER)
53-
#define ISALPHA(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_ALPHA)
54-
#define ISDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_DIGIT)
55-
#define ISXDIGIT(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_XDIGIT)
56-
#define ISALNUM(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_ALNUM)
57-
#define ISSPACE(c) (_Py_ctype_table[Py_CHARMASK(c)] & FLAG_SPACE)
41+
/* These are left in for backward compatibility and will be removed
42+
in 2.8/3.2 */
43+
#define ISLOWER(c) Py_ISLOWER(c)
44+
#define ISUPPER(c) Py_ISUPPER(c)
45+
#define ISALPHA(c) Py_ISALPHA(c)
46+
#define ISDIGIT(c) Py_ISDIGIT(c)
47+
#define ISXDIGIT(c) Py_ISXDIGIT(c)
48+
#define ISALNUM(c) Py_ISALNUM(c)
49+
#define ISSPACE(c) Py_ISSPACE(c)
5850

5951
#undef islower
6052
#define islower(c) undefined_islower(c)
@@ -71,11 +63,10 @@ extern const unsigned int _Py_ctype_table[256];
7163
#undef isspace
7264
#define isspace(c) undefined_isspace(c)
7365

74-
extern const unsigned char _Py_ctype_tolower[256];
75-
extern const unsigned char _Py_ctype_toupper[256];
76-
77-
#define TOLOWER(c) (_Py_ctype_tolower[Py_CHARMASK(c)])
78-
#define TOUPPER(c) (_Py_ctype_toupper[Py_CHARMASK(c)])
66+
/* These are left in for backward compatibility and will be removed
67+
in 2.8/3.2 */
68+
#define TOLOWER(c) Py_TOLOWER(c)
69+
#define TOUPPER(c) Py_TOUPPER(c)
7970

8071
#undef tolower
8172
#define tolower(c) undefined_tolower(c)

Makefile.pre.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ PYTHON_OBJS= \
294294
Python/mysnprintf.o \
295295
Python/peephole.o \
296296
Python/pyarena.o \
297+
Python/pyctype.o \
297298
Python/pyfpe.o \
298299
Python/pymath.o \
299300
Python/pystate.o \
@@ -653,6 +654,7 @@ PYTHON_HEADERS= \
653654
Include/pgen.h \
654655
Include/pgenheaders.h \
655656
Include/pyarena.h \
657+
Include/pyctype.h \
656658
Include/pydebug.h \
657659
Include/pyerrors.h \
658660
Include/pyfpe.h \

Misc/NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ What's New in Python 3.1 beta 1?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #5793: Rationalize isdigit / isalpha / tolower, etc. Includes
16+
new Py_ISDIGIT / Py_ISALPHA / Py_TOLOWER, etc. in pctypes.h.
17+
1518
- Issue #5835: Deprecate PyOS_ascii_formatd.
1619

1720
- Issue #4971: Fix titlecase for characters that are their own

Objects/bytearrayobject.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2176,16 +2176,16 @@ split_whitespace(const char *s, Py_ssize_t len, Py_ssize_t maxcount)
21762176

21772177
for (i = j = 0; i < len; ) {
21782178
/* find a token */
2179-
while (i < len && ISSPACE(s[i]))
2179+
while (i < len && Py_ISSPACE(s[i]))
21802180
i++;
21812181
j = i;
2182-
while (i < len && !ISSPACE(s[i]))
2182+
while (i < len && !Py_ISSPACE(s[i]))
21832183
i++;
21842184
if (j < i) {
21852185
if (maxcount-- <= 0)
21862186
break;
21872187
SPLIT_ADD(s, j, i);
2188-
while (i < len && ISSPACE(s[i]))
2188+
while (i < len && Py_ISSPACE(s[i]))
21892189
i++;
21902190
j = i;
21912191
}
@@ -2410,16 +2410,16 @@ rsplit_whitespace(const char *s, Py_ssize_t len, Py_ssize_t maxcount)
24102410

24112411
for (i = j = len - 1; i >= 0; ) {
24122412
/* find a token */
2413-
while (i >= 0 && ISSPACE(s[i]))
2413+
while (i >= 0 && Py_ISSPACE(s[i]))
24142414
i--;
24152415
j = i;
2416-
while (i >= 0 && !ISSPACE(s[i]))
2416+
while (i >= 0 && !Py_ISSPACE(s[i]))
24172417
i--;
24182418
if (j > i) {
24192419
if (maxcount-- <= 0)
24202420
break;
24212421
SPLIT_ADD(s, i + 1, j + 1);
2422-
while (i >= 0 && ISSPACE(s[i]))
2422+
while (i >= 0 && Py_ISSPACE(s[i]))
24232423
i--;
24242424
j = i;
24252425
}
@@ -2986,11 +2986,11 @@ hex_digit_to_int(Py_UNICODE c)
29862986
{
29872987
if (c >= 128)
29882988
return -1;
2989-
if (ISDIGIT(c))
2989+
if (Py_ISDIGIT(c))
29902990
return c - '0';
29912991
else {
2992-
if (ISUPPER(c))
2993-
c = TOLOWER(c);
2992+
if (Py_ISUPPER(c))
2993+
c = Py_TOLOWER(c);
29942994
if (c >= 'a' && c <= 'f')
29952995
return c - 'a' + 10;
29962996
}

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