Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
61c345fa
Kaydet (Commit)
61c345fa
authored
Eyl 04, 2001
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Rename the -D option to -Q, to avoid a Jython option name conflict.
üst
a1c1b0f4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
13 deletions
+13
-13
NEWS
Misc/NEWS
+5
-5
main.c
Modules/main.c
+7
-7
fixdiv.py
Tools/scripts/fixdiv.py
+1
-1
No files found.
Misc/NEWS
Dosyayı görüntüle @
61c345fa
...
...
@@ -32,14 +32,14 @@ Core
this situation, and -Werror::OverflowWarning to revert to the old
OverflowError exception.
- A new command line option, -
D
<arg>, is added to control run-time
- A new command line option, -
Q
<arg>, is added to control run-time
warnings for the use of classic division. (See PEP 238.) Possible
values are -
Dold, -Dwarn, and -Dnew. The default is -D
old, meaning
values are -
Qold, -Qwarn, and -Qnew. The default is -Q
old, meaning
the / operator has its classic meaning and no warnings are issued.
Using -
D
warn issues a run-time warning about all uses of classic
division for int, long, float and complex arguments. Using -
D
new is
Using -
Q
warn issues a run-time warning about all uses of classic
division for int, long, float and complex arguments. Using -
Q
new is
questionable; it turns on new division by default, but only in the
__main__ module. You can usefully combine -
Dwarn and -D
new: this
__main__ module. You can usefully combine -
Qwarn and -Q
new: this
gives the __main__ module new division, and warns about classic
division everywhere else.
...
...
Modules/main.c
Dosyayı görüntüle @
61c345fa
...
...
@@ -29,7 +29,7 @@ static char **orig_argv;
static
int
orig_argc
;
/* command line options */
#define BASE_OPTS "c:d
D:EhiO
StuUvVW:xX"
#define BASE_OPTS "c:d
EhiOQ:
StuUvVW:xX"
#ifndef RISCOS
#define PROGRAM_OPTS BASE_OPTS
...
...
@@ -50,15 +50,15 @@ static char *usage_1 = "\
Options and arguments (and corresponding environment variables):
\n
\
-c cmd : program passed in as string (terminates option list)
\n
\
-d : debug output from parser (also PYTHONDEBUG=x)
\n
\
-D arg : division options: -Dold (default), -Dwarn, -Dnew
\n
\
-E : ignore environment variables (such as PYTHONPATH)
\n
\
-h : print this help message and exit
\n
\
"
;
static
char
*
usage_2
=
"\
-i : inspect interactively after running script, (also PYTHONINSPECT=x)
\n
\
and force prompts, even if stdin does not appear to be a terminal
\n
\
"
;
static
char
*
usage_2
=
"\
-O : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)
\n
\
-OO : remove doc-strings in addition to the -O optimizations
\n
\
-Q arg : division options: -Qold (default), -Qwarn, -Qnew
\n
\
-S : don't imply 'import site' on initialization
\n
\
-t : issue warnings about inconsistent tab usage (-tt: issue errors)
\n
\
-u : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)
\n
\
...
...
@@ -155,7 +155,7 @@ Py_Main(int argc, char **argv)
Py_DebugFlag
++
;
break
;
case
'
D
'
:
case
'
Q
'
:
if
(
strcmp
(
_PyOS_optarg
,
"old"
)
==
0
)
{
Py_DivisionWarningFlag
=
0
;
break
;
...
...
@@ -170,8 +170,8 @@ Py_Main(int argc, char **argv)
break
;
}
fprintf
(
stderr
,
"-
D
option should be "
"`-
Dold', `-Dwarn' or `-D
new' only
\n
"
);
"-
Q
option should be "
"`-
Qold', `-Qwarn' or `-Q
new' only
\n
"
);
usage
(
2
,
argv
[
0
]);
/* NOTREACHED */
...
...
Tools/scripts/fixdiv.py
Dosyayı görüntüle @
61c345fa
...
...
@@ -2,7 +2,7 @@
"""fixdiv - tool to fix division operators.
To use this tool, first run `python -
D
warn yourscript.py 2>warnings'.
To use this tool, first run `python -
Q
warn yourscript.py 2>warnings'.
This runs the script `yourscript.py' while writing warning messages
about all uses of the classic division operator to the file
`warnings'. The warnings look like this:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment