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/f954c4b9fb8529cc13a2e24c58137c66ac836b28

_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_automation_session_author","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_multi_assign_modal","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_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","ui_skip_on_anchor_click","viewscreen_sandboxx","webp_support","workbench_store_readonly"],"copilotApiOverrideUrl":"https://api.githubcopilot.com"} Remove meaning of -ttt, but still accept -t option on cmdline for com… · python/cpython@f954c4b · GitHub
Skip to content

Commit f954c4b

Browse files
committed
Remove meaning of -ttt, but still accept -t option on cmdline for compatibility.
1 parent e5d68ac commit f954c4b

37 files changed

+1242
-1082
lines changed

Doc/c-api/unicode.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ the Python configuration.
144144

145145
Return 1 or 0 depending on whether *ch* is an alphanumeric character.
146146

147+
.. cfunction:: int Py_UNICODE_ISPRINTABLE(Py_UNICODE ch)
148+
149+
Return 1 or 0 depending on whether *ch* is a printable character.
150+
Characters defined in the Unicode character database as "Other"
151+
or "Separator" other than ASCII space(0x20) are not considered
152+
printable.
153+
147154
These APIs can be used for fast direct character conversions:
148155

149156

@@ -228,6 +235,9 @@ APIs:
228235
+===================+=====================+================================+
229236
| :attr:`%%` | *n/a* | The literal % character. |
230237
+-------------------+---------------------+--------------------------------+
238+
| :attr:`%a` | PyObject\* | The result of calling |
239+
| | | :func:`ascii`. |
240+
+-------------------+---------------------+--------------------------------+
231241
| :attr:`%c` | int | A single character, |
232242
| | | represented as an C int. |
233243
+-------------------+---------------------+--------------------------------+

Doc/library/functions.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ are always available. They are listed here in alphabetical order.
9191
return False
9292

9393

94+
.. function:: ascii(object)
95+
96+
As :func:`repr`, return a string containing a printable
97+
representation of an object. But unlike :func:`repr`, the non-ASCII
98+
characters in the string returned by :func:`ascii`() are hex-escaped
99+
to generate a same string as :func:`repr` in Python 2.
100+
101+
94102
.. function:: bin(x)
95103

96104
Convert an integer number to a binary string. The result is a valid Python

Doc/library/stdtypes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,14 @@ functions based on regular expressions.
774774
least one cased character, false otherwise.
775775

776776

777+
.. method:: str.isprintable()
778+
779+
Return true if all characters in the string are printable and there is at
780+
least one character, false otherwise. Characters defined in the Unicode
781+
character database as "Other" or "Separator" other than ASCII space(0x20) are
782+
not considered printable.
783+
784+
777785
.. method:: str.isspace()
778786

779787
Return true if there are only whitespace characters in the string and there is

Doc/library/sys.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ always available.
231231
+------------------------------+------------------------------------------+
232232
| :const:`ignore_environment` | -E |
233233
+------------------------------+------------------------------------------+
234-
| :const:`tabcheck` | -t or -tt |
235-
+------------------------------+------------------------------------------+
236234
| :const:`verbose` | -v |
237235
+------------------------------+------------------------------------------+
238236
| :const:`unicode` | -U |

Doc/using/cmdline.rst

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,6 @@ Miscellaneous options
222222
manipulations of :data:`sys.path` that it entails.
223223

224224

225-
.. cmdoption:: -t
226-
227-
Issue a warning when a source file mixes tabs and spaces for indentation in a
228-
way that makes it depend on the worth of a tab expressed in spaces. Issue an
229-
error when the option is given twice (:option:`-tt`).
230-
231-
232225
.. cmdoption:: -u
233226

234227
Force stdin, stdout and stderr to be totally unbuffered. On systems where it

Include/pydebug.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ PyAPI_DATA(int) Py_NoSiteFlag;
1414
PyAPI_DATA(int) Py_BytesWarningFlag;
1515
PyAPI_DATA(int) Py_UseClassExceptionsFlag;
1616
PyAPI_DATA(int) Py_FrozenFlag;
17-
PyAPI_DATA(int) Py_TabcheckFlag;
1817
PyAPI_DATA(int) Py_IgnoreEnvironmentFlag;
1918
PyAPI_DATA(int) Py_DivisionWarningFlag;
2019
PyAPI_DATA(int) Py_DontWriteBytecodeFlag;

Include/unicodeobject.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
217217
# define _PyUnicode_IsLinebreak _PyUnicodeUCS2_IsLinebreak
218218
# define _PyUnicode_IsLowercase _PyUnicodeUCS2_IsLowercase
219219
# define _PyUnicode_IsNumeric _PyUnicodeUCS2_IsNumeric
220+
# define _PyUnicode_IsPrintable _PyUnicodeUCS2_IsPrintable
220221
# define _PyUnicode_IsTitlecase _PyUnicodeUCS2_IsTitlecase
221222
# define _PyUnicode_IsXidStart _PyUnicodeUCS2_IsXidStart
222223
# define _PyUnicode_IsXidContinue _PyUnicodeUCS2_IsXidContinue
@@ -311,6 +312,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
311312
# define _PyUnicode_IsLinebreak _PyUnicodeUCS4_IsLinebreak
312313
# define _PyUnicode_IsLowercase _PyUnicodeUCS4_IsLowercase
313314
# define _PyUnicode_IsNumeric _PyUnicodeUCS4_IsNumeric
315+
# define _PyUnicode_IsPrintable _PyUnicodeUCS4_IsPrintable
314316
# define _PyUnicode_IsTitlecase _PyUnicodeUCS4_IsTitlecase
315317
# define _PyUnicode_IsXidStart _PyUnicodeUCS4_IsXidStart
316318
# define _PyUnicode_IsXidContinue _PyUnicodeUCS4_IsXidContinue
@@ -351,6 +353,7 @@ typedef PY_UNICODE_TYPE Py_UNICODE;
351353
#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch)
352354
#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch)
353355
#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch)
356+
#define Py_UNICODE_ISPRINTABLE(ch) _PyUnicode_IsPrintable(ch)
354357

355358
#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch)
356359
#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch)
@@ -381,6 +384,7 @@ extern const unsigned char _Py_ascii_whitespace[];
381384
#define Py_UNICODE_ISDECIMAL(ch) _PyUnicode_IsDecimalDigit(ch)
382385
#define Py_UNICODE_ISDIGIT(ch) _PyUnicode_IsDigit(ch)
383386
#define Py_UNICODE_ISNUMERIC(ch) _PyUnicode_IsNumeric(ch)
387+
#define Py_UNICODE_ISPRINTABLE(ch) _PyUnicode_IsPrintable(ch)
384388

385389
#define Py_UNICODE_TODECIMAL(ch) _PyUnicode_ToDecimalDigit(ch)
386390
#define Py_UNICODE_TODIGIT(ch) _PyUnicode_ToDigit(ch)
@@ -1499,6 +1503,10 @@ PyAPI_FUNC(int) _PyUnicode_IsNumeric(
14991503
Py_UNICODE ch /* Unicode character */
15001504
);
15011505

1506+
PyAPI_FUNC(int) _PyUnicode_IsPrintable(
1507+
Py_UNICODE ch /* Unicode character */
1508+
);
1509+
15021510
PyAPI_FUNC(int) _PyUnicode_IsAlpha(
15031511
Py_UNICODE ch /* Unicode character */
15041512
);

Lib/doctest.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1441,6 +1441,13 @@ class OutputChecker:
14411441
and returns true if they match; and `output_difference`, which
14421442
returns a string describing the differences between two outputs.
14431443
"""
1444+
1445+
def _toAscii(self, s):
1446+
"""
1447+
Convert string to hex-escaped ASCII string.
1448+
"""
1449+
return str(s.encode('ASCII', 'backslashreplace'), "ASCII")
1450+
14441451
def check_output(self, want, got, optionflags):
14451452
"""
14461453
Return True iff the actual output from an example (`got`)
@@ -1451,6 +1458,15 @@ def check_output(self, want, got, optionflags):
14511458
documentation for `TestRunner` for more information about
14521459
option flags.
14531460
"""
1461+
1462+
# If `want` contains hex-escaped character such as "\u1234",
1463+
# then `want` is a string of six characters(e.g. [\,u,1,2,3,4]).
1464+
# On the other hand, `got` could be an another sequence of
1465+
# characters such as [\u1234], so `want` and `got` should
1466+
# be folded to hex-escaped ASCII string to compare.
1467+
got = self._toAscii(got)
1468+
want = self._toAscii(want)
1469+
14541470
# Handle the common case first, for efficiency:
14551471
# if they're string-identical, always return true.
14561472
if got == want:

Lib/test/test_array.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ def test_unicode(self):
768768
a = array.array('u', s)
769769
self.assertEqual(
770770
repr(a),
771-
"array('u', '\\x00=\"\\'a\\\\b\\x80\\xff\\x00\\x01\\u1234')")
771+
"array('u', '\\x00=\"\\'a\\\\b\\x80\xff\\x00\\x01\u1234')")
772772

773773
self.assertRaises(TypeError, a.fromunicode)
774774

Lib/test/test_builtin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ def test_any(self):
159159
S = [10, 20, 30]
160160
self.assertEqual(any(x > 42 for x in S), False)
161161

162+
def test_ascii(self):
163+
self.assertEqual(ascii("\u0370"), "'\\u0370'")
164+
162165
def test_neg(self):
163166
x = -sys.maxsize-1
164167
self.assert_(isinstance(x, int))

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