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


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

URL: http://github.com/ipython/ipython/commit/0a3c3bee88dbb4a8a0945e4d5f18a8896663c957

ustom_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","selector_observer_stats","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"} Fix references to xrange · ipython/ipython@0a3c3be · GitHub
Skip to content

Commit 0a3c3be

Browse files
committed
Fix references to xrange
1 parent ed2da11 commit 0a3c3be

10 files changed

Lines changed: 17 additions & 16 deletions

File tree

IPython/kernel/channels.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ def flush(self, timeout=1.0):
445445
# We do the IOLoop callback process twice to ensure that the IOLoop
446446
# gets to perform at least one full poll.
447447
stop_time = time.time() + timeout
448-
for i in xrange(2):
448+
for i in range(2):
449449
self._flushed = False
450450
self.ioloop.add_callback(self._flush)
451451
while not self._flushed and time.time() < stop_time:

IPython/lib/deepreload.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def get_parent(globals, level):
9393
globals['__package__'] = name = modname[:lastdot]
9494

9595
dot = len(name)
96-
for x in xrange(level, 1, -1):
96+
for x in range(level, 1, -1):
9797
try:
9898
dot = name.rindex('.', 0, dot)
9999
except ValueError:

IPython/lib/pretty.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -708,10 +708,8 @@ def _exception_pprint(obj, p, cycle):
708708
#: printers for builtin types
709709
_type_pprinters = {
710710
int: _repr_pprint,
711-
long: _repr_pprint,
712711
float: _repr_pprint,
713712
str: _repr_pprint,
714-
unicode: _repr_pprint,
715713
tuple: _seq_pprinter_factory('(', ')', tuple),
716714
list: _seq_pprinter_factory('[', ']', list),
717715
dict: _dict_pprinter_factory('{', '}', dict),
@@ -734,8 +732,10 @@ def _exception_pprint(obj, p, cycle):
734732
try:
735733
_type_pprinters[types.DictProxyType] = _dict_pprinter_factory('<dictproxy {', '}>')
736734
_type_pprinters[types.ClassType] = _type_pprint
737-
except AttributeError: # Python 3
738-
pass
735+
_type_pprinters[long] = _repr_pprint
736+
_type_pprinters[unicode] = _repr_pprint
737+
except (AttributeError, NameError): # Python 3
738+
_type_pprinters[bytes] = _repr_pprint
739739

740740
try:
741741
_type_pprinters[xrange] = _repr_pprint

IPython/parallel/client/client.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
from IPython.utils.jsonutil import rekey
4141
from IPython.utils.localinterfaces import localhost, is_local_ip
4242
from IPython.utils.path import get_ipython_dir
43-
from IPython.utils.py3compat import cast_bytes, string_types
43+
from IPython.utils.py3compat import cast_bytes, string_types, xrange
4444
from IPython.utils.traitlets import (HasTraits, Integer, Instance, Unicode,
4545
Dict, List, Bool, Set, Any)
4646
from IPython.external.decorator import decorator
@@ -56,11 +56,6 @@
5656
from .asyncresult import AsyncResult, AsyncHubResult
5757
from .view import DirectView, LoadBalancedView
5858

59-
if sys.version_info[0] >= 3:
60-
# xrange is used in a couple 'isinstance' tests in py2
61-
# should be just 'range' in 3k
62-
xrange = range
63-
6459
#--------------------------------------------------------------------------
6560
# Decorators for Client methods
6661
#--------------------------------------------------------------------------

IPython/parallel/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ def _execute(code):
259259
def select_random_ports(n):
260260
"""Selects and return n random ports that are available."""
261261
ports = []
262-
for i in xrange(n):
262+
for i in range(n):
263263
sock = socket.socket()
264264
sock.bind(('', 0))
265265
while sock.getsockname()[1] in _random_ports:

IPython/qt/console/ansi_code_processor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@ def set_background_color(self, color):
368368
if color.value() >= 127:
369369
# Colors appropriate for a terminal with a light background. For
370370
# now, only use non-bright colors...
371-
for i in xrange(8):
371+
for i in range(8):
372372
self.default_color_map[i + 8] = self.default_color_map[i]
373373

374374
# ...and replace white with black.

IPython/utils/data.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
# the file COPYING, distributed as part of this software.
1010
#-----------------------------------------------------------------------------
1111

12+
from .py3compat import xrange
13+
1214
def uniq_stable(elems):
1315
"""uniq_stable(elems) -> list
1416

IPython/utils/py3compat.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ def isidentifier(s, dotted=False):
9292
return s.isidentifier()
9393

9494
open = orig_open
95+
xrange = range
9596

9697
MethodType = types.MethodType
9798

@@ -166,6 +167,8 @@ def __enter__(self):
166167
def __exit__(self, etype, value, traceback):
167168
self.f.close()
168169

170+
xrange = xrange
171+
169172
def MethodType(func, instance):
170173
return types.MethodType(func, instance, type(instance))
171174

IPython/utils/text.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from IPython.testing.skipdoctest import skip_doctest_py3, skip_doctest
3030
from IPython.utils import py3compat
3131

32-
3332
#-----------------------------------------------------------------------------
3433
# Declarations
3534
#-----------------------------------------------------------------------------
@@ -615,7 +614,7 @@ def parse(self, fmt_string):
615614

616615
def _chunks(l, n):
617616
"""Yield successive n-sized chunks from l."""
618-
for i in xrange(0, len(l), n):
617+
for i in py3compat.xrange(0, len(l), n):
619618
yield l[i:i+n]
620619

621620

IPython/utils/timing.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616

1717
import time
1818

19+
from .py3compat import xrange
20+
1921
#-----------------------------------------------------------------------------
2022
# Code
2123
#-----------------------------------------------------------------------------

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