Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit443ab1d

Browse files
bsolomon1124miss-islington
authored andcommitted
bpo-40561: Add docstrings for webbrowser open functions (pythonGH-19999)
Co-authored-by: Brad Solomon <brsolomon@deloitte.com>Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>(cherry picked from commitef7973a)Co-authored-by: Brad Solomon <brad.solomon.1124@gmail.com>
1 parent5d555fa commit443ab1d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

‎Lib/webbrowser.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,14 @@ def get(using=None):
6969
# instead of "from webbrowser import *".
7070

7171
defopen(url,new=0,autoraise=True):
72+
"""Display url using the default browser.
73+
74+
If possible, open url in a location determined by new.
75+
- 0: the same browser window (the default).
76+
- 1: a new browser window.
77+
- 2: a new browser page ("tab").
78+
If possible, autoraise raises the window (the default) or not.
79+
"""
7280
if_tryorderisNone:
7381
with_lock:
7482
if_tryorderisNone:
@@ -80,9 +88,17 @@ def open(url, new=0, autoraise=True):
8088
returnFalse
8189

8290
defopen_new(url):
91+
"""Open url in a new window of the default browser.
92+
93+
If not possible, then open url in the only browser window.
94+
"""
8395
returnopen(url,1)
8496

8597
defopen_new_tab(url):
98+
"""Open url in a new page ("tab") of the default browser.
99+
100+
If not possible, then the behavior becomes equivalent to open_new().
101+
"""
86102
returnopen(url,2)
87103

88104

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Provide docstrings for webbrowser open functions.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp