Python-checkins
Threads by month
- ----- 2024 -----
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
December 2016
- 3 participants
- 587 discussions
cpython (2.7): Try to fix test.test_support.rmtree() on Windows for fixing issue28847 tests.
by serhiy.storchaka 02 Dec '16
by serhiy.storchaka 02 Dec '16
02 Dec '16
https://hg.python.org/cpython/rev/cb4a892e9b66
changeset: 105424:cb4a892e9b66
branch: 2.7
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Sat Dec 03 07:57:54 2016 +0200
summary:
Try to fix test.test_support.rmtree() on Windows for fixing issue28847 tests.
files:
Lib/test/test_support.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -239,9 +239,9 @@
fullname = os.path.join(path, name)
if os.path.isdir(fullname):
_waitfor(_rmtree_inner, fullname, waitall=True)
- _force_run(path, os.rmdir, fullname)
+ _force_run(fullname, os.rmdir, fullname)
else:
- _force_run(path, os.unlink, fullname)
+ _force_run(fullname, os.unlink, fullname)
_waitfor(_rmtree_inner, path, waitall=True)
_waitfor(lambda p: _force_run(p, os.rmdir, p), path)
else:
--
Repository URL: https://hg.python.org/cpython
1
0
https://hg.python.org/cpython/rev/dc7c86de9e13
changeset: 105423:dc7c86de9e13
branch: 2.7
parent: 105418:5b40d81e8883
user: Martin Panter <vadmium+py(a)gmail.com>
date: Sat Dec 03 03:44:16 2016 +0000
summary:
Issue #28847: Fix spelling
files:
Misc/NEWS | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -13,7 +13,7 @@
- Issue #5322: Fixed setting __new__ to a PyCFunction inside Python code.
Original patch by Andreas Stührk.
-- Issue #28847: dubmdbm no longer writes the index file in when it is not
+- Issue #28847: dumbdbm no longer writes the index file in when it is not
changed and supports reading read-only files.
- Issue #11145: Fixed miscellaneous issues with C-style formatting of types
--
Repository URL: https://hg.python.org/cpython
1
0
https://hg.python.org/cpython/rev/555b32f418ce
changeset: 105422:555b32f418ce
branch: 3.5
parent: 105419:d64e37b9204e
parent: 105408:14c80065c36e
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Fri Dec 02 23:34:24 2016 +0200
summary:
Merge heads
files:
config.guess | 174 ++++++++++++++++++++++++--------------
config.sub | 75 +++++++++++----
2 files changed, 161 insertions(+), 88 deletions(-)
diff --git a/config.guess b/config.guess
--- a/config.guess
+++ b/config.guess
@@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2014 Free Software Foundation, Inc.
+# Copyright 1992-2016 Free Software Foundation, Inc.
-timestamp='2014-03-23'
+timestamp='2016-10-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -24,12 +24,12 @@
# program. This Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
#
-# Originally written by Per Bothner.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.gues…
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
#
-# Please send patches with a ChangeLog entry to config-patches(a)gnu.org.
+# Please send patches to <config-patches(a)gnu.org>.
me=`echo "$0" | sed -e 's,.*/,,'`
@@ -50,7 +50,7 @@
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -168,19 +168,29 @@
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ /sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || \
+ echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
+ earmv*)
+ arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine=${arch}${endian}-unknown
+ ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
+ # to ELF recently (or will in the future) and ABI.
case "${UNAME_MACHINE_ARCH}" in
+ earm*)
+ os=netbsdelf
+ ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
@@ -197,6 +207,13 @@
os=netbsd
;;
esac
+ # Determine ABI tags.
+ case "${UNAME_MACHINE_ARCH}" in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+ ;;
+ esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
@@ -207,13 +224,13 @@
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
+ echo "${machine}-${os}${release}${abi}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@@ -223,6 +240,10 @@
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
+ exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
@@ -235,6 +256,9 @@
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
+ *:Sortix:*:*)
+ echo ${UNAME_MACHINE}-unknown-sortix
+ exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
@@ -251,42 +275,42 @@
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
+ UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
+ UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
+ UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
+ UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
+ UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
+ UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
+ UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
+ UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
+ UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
@@ -359,16 +383,16 @@
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
- SUN_ARCH="i386"
+ SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
- SUN_ARCH="x86_64"
+ SUN_ARCH=x86_64
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@@ -393,7 +417,7 @@
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
@@ -579,8 +603,9 @@
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
+ if [ -x /usr/bin/lslpp ] ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
@@ -617,13 +642,13 @@
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
@@ -662,11 +687,11 @@
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
+ if [ ${HP_ARCH} = hppa2.0w ]
then
eval $set_cc_for_build
@@ -679,12 +704,12 @@
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
- HP_ARCH="hppa2.0w"
+ HP_ARCH=hppa2.0w
else
- HP_ARCH="hppa64"
+ HP_ARCH=hppa64
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
@@ -789,14 +814,14 @@
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
@@ -878,7 +903,7 @@
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
@@ -901,7 +926,7 @@
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
@@ -932,6 +957,9 @@
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-${LIBC}
exit ;;
+ e2k:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
@@ -944,6 +972,9 @@
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
+ k1om:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
@@ -969,6 +1000,9 @@
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
+ mips64el:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
openrisc*:Linux:*:*)
echo or1k-unknown-linux-${LIBC}
exit ;;
@@ -1001,6 +1035,9 @@
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;;
+ riscv32:Linux:*:* | riscv64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
@@ -1020,7 +1057,7 @@
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
@@ -1099,7 +1136,7 @@
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
+ # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
@@ -1248,6 +1285,9 @@
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
+ SX-ACE:SUPER-UX:*:*)
+ echo sxace-nec-superux${UNAME_RELEASE}
+ exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
@@ -1261,9 +1301,9 @@
UNAME_PROCESSOR=powerpc
fi
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
@@ -1285,7 +1325,7 @@
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
+ if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
@@ -1316,7 +1356,7 @@
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- if test "$cputype" = "386"; then
+ if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
@@ -1358,7 +1398,7 @@
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+ echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
@@ -1369,23 +1409,25 @@
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
+ amd64:Isilon\ OneFS:*:*)
+ echo x86_64-unknown-onefs
+ exit ;;
esac
cat >&2 <<EOF
$0: unable to guess system type
-This script, last modified $timestamp, has failed to recognize
-the operating system you are using. It is advised that you
-download the most up to date version of the config scripts from
+This script (version $timestamp), has failed to recognize the
+operating system you are using. If your script is old, overwrite
+config.guess and config.sub with the latest versions from:
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.gues…
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
- http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;…
+ http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
-If the version you run ($0) is already up to date, please
-send the following data and any information you think might be
-pertinent to <config-patches(a)gnu.org> in order to provide the needed
-information to handle your system.
+If $0 has already been updated, send the following data and any
+information you think might be pertinent to config-patches(a)gnu.org to
+provide the necessary information to handle your system.
config.guess timestamp = $timestamp
diff --git a/config.sub b/config.sub
--- a/config.sub
+++ b/config.sub
@@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2014 Free Software Foundation, Inc.
+# Copyright 1992-2016 Free Software Foundation, Inc.
-timestamp='2014-05-01'
+timestamp='2016-11-19'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@
# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches with a ChangeLog entry to config-patches(a)gnu.org.
+# Please send patches to <config-patches(a)gnu.org>.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -33,7 +33,7 @@
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;…
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -53,8 +53,7 @@
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
@@ -68,7 +67,7 @@
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2014 Free Software Foundation, Inc.
+Copyright 1992-2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -117,8 +116,8 @@
case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
+ knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+ kopensolaris*-gnu* | cloudabi*-eabi* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -255,12 +254,13 @@
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
+ | ba \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
| d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
+ | e2k | epiphany \
+ | fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
@@ -301,10 +301,12 @@
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pru \
| pyramid \
+ | riscv32 | riscv64 \
| rl78 | rx \
| score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@@ -312,6 +314,7 @@
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+ | visium \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
@@ -326,6 +329,9 @@
c6x)
basic_machine=tic6x-unknown
;;
+ leon|leon[3-9])
+ basic_machine=sparc-$basic_machine
+ ;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
basic_machine=$basic_machine-unknown
os=-none
@@ -371,12 +377,13 @@
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
+ | ba-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| c8051-* | clipper-* | craynv-* | cydra-* \
| d10v-* | d30v-* | dlx-* \
- | elxsi-* \
+ | e2k-* | elxsi-* \
| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
@@ -422,13 +429,15 @@
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pru-* \
| pyramid-* \
+ | riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
+ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
@@ -436,6 +445,7 @@
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
+ | visium-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
@@ -512,6 +522,9 @@
basic_machine=i386-pc
os=-aros
;;
+ asmjs)
+ basic_machine=asmjs-unknown
+ ;;
aux)
basic_machine=m68k-apple
os=-aux
@@ -632,6 +645,14 @@
basic_machine=m68k-bull
os=-sysv3
;;
+ e500v[12])
+ basic_machine=powerpc-unknown
+ os=$os"spe"
+ ;;
+ e500v[12]-*)
+ basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ os=$os"spe"
+ ;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
@@ -773,6 +794,9 @@
basic_machine=m68k-isi
os=-sysv
;;
+ leon-*|leon[3-9]-*)
+ basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+ ;;
m68knommu)
basic_machine=m68k-unknown
os=-linux
@@ -828,6 +852,10 @@
basic_machine=powerpc-unknown
os=-morphos
;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ os=-moxiebox
+ ;;
msdos)
basic_machine=i386-pc
os=-msdos
@@ -1004,7 +1032,7 @@
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
+ ppcle | powerpclittle)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
@@ -1014,7 +1042,7 @@
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ ppc64le | powerpc64little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
@@ -1360,27 +1388,28 @@
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
- | -aos* | -aros* \
+ | -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
- | -bitrig* | -openbsd* | -solidbsd* \
+ | -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
+ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
- | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
+ | -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
- | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
- | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
+ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
+ | -onefs* | -tirtos* | -phoenix* | -fuchsia*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1512,6 +1541,8 @@
;;
-nacl*)
;;
+ -ios)
+ ;;
-none)
;;
*)
--
Repository URL: https://hg.python.org/cpython
1
0
cpython (2.7): Issue #21818: Fixed references to classes that have names matching with module
by serhiy.storchaka 02 Dec '16
by serhiy.storchaka 02 Dec '16
02 Dec '16
https://hg.python.org/cpython/rev/5b40d81e8883
changeset: 105418:5b40d81e8883
branch: 2.7
parent: 105414:ea904d4b3634
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Fri Dec 02 23:13:42 2016 +0200
summary:
Issue #21818: Fixed references to classes that have names matching with module
names.
files:
Doc/library/array.rst | 4 +-
Doc/library/configparser.rst | 20 +++---
Doc/library/cookie.rst | 10 +-
Doc/library/cookielib.rst | 20 +++---
Doc/library/datetime.rst | 4 +-
Doc/library/docxmlrpcserver.rst | 6 +-
Doc/library/dumbdbm.rst | 2 +-
Doc/library/formatter.rst | 2 +-
Doc/library/gzip.rst | 2 +-
Doc/library/htmllib.rst | 12 ++--
Doc/library/io.rst | 12 ++--
Doc/library/mimewriter.rst | 10 +-
Doc/library/mmap.rst | 6 +-
Doc/library/mutex.rst | 2 +-
Doc/library/netrc.rst | 10 +-
Doc/library/queue.rst | 8 +-
Doc/library/scrolledtext.rst | 4 +-
Doc/library/simplexmlrpcserver.rst | 8 +-
Doc/library/socket.rst | 2 +-
Doc/library/stringio.rst | 14 ++--
Doc/library/userdict.rst | 48 +++++++++---------
Doc/whatsnew/2.1.rst | 2 +-
Doc/whatsnew/2.2.rst | 2 +-
Doc/whatsnew/2.3.rst | 12 ++--
Doc/whatsnew/2.4.rst | 2 +-
Doc/whatsnew/2.5.rst | 6 +-
Doc/whatsnew/2.6.rst | 18 +++---
27 files changed, 124 insertions(+), 124 deletions(-)
diff --git a/Doc/library/array.rst b/Doc/library/array.rst
--- a/Doc/library/array.rst
+++ b/Doc/library/array.rst
@@ -75,7 +75,7 @@
.. data:: ArrayType
- Obsolete alias for :class:`array`.
+ Obsolete alias for :class:`~array.array`.
Array objects support the ordinary sequence operations of indexing, slicing,
concatenation, and multiplication. When using slice assignment, the assigned
@@ -249,7 +249,7 @@
empty, otherwise it is a string if the *typecode* is ``'c'``, otherwise it is a
list of numbers. The string is guaranteed to be able to be converted back to an
array with the same type and value using :func:`eval`, so long as the
-:func:`array` function has been imported using ``from array import array``.
+:class:`~array.array` class has been imported using ``from array import array``.
Examples::
array('l')
diff --git a/Doc/library/configparser.rst b/Doc/library/configparser.rst
--- a/Doc/library/configparser.rst
+++ b/Doc/library/configparser.rst
@@ -21,7 +21,7 @@
single: ini file
single: Windows ini file
-This module defines the class :class:`ConfigParser`. The :class:`ConfigParser`
+This module defines the class :class:`~ConfigParser.ConfigParser`. The :class:`~ConfigParser.ConfigParser`
class implements a basic configuration file parser language which provides a
structure similar to what you would find on Microsoft Windows INI files. You
can use this to write Python programs which can be customized by end users
@@ -74,12 +74,12 @@
would resolve the ``%(dir)s`` to the value of ``dir`` (``frob`` in this case).
All reference expansions are done on demand.
-Default values can be specified by passing them into the :class:`ConfigParser`
+Default values can be specified by passing them into the :class:`~ConfigParser.ConfigParser`
constructor as a dictionary. Additional defaults may be passed into the
:meth:`get` method which will override all others.
Sections are normally stored in a built-in dictionary. An alternative dictionary
-type can be passed to the :class:`ConfigParser` constructor. For example, if a
+type can be passed to the :class:`~ConfigParser.ConfigParser` constructor. For example, if a
dictionary type is passed that sorts its keys, the sections will be sorted on
write-back, as will be the keys within each section.
@@ -135,7 +135,7 @@
.. class:: SafeConfigParser([defaults[, dict_type[, allow_no_value]]])
- Derived class of :class:`ConfigParser` that implements a more-sane variant of
+ Derived class of :class:`~ConfigParser.ConfigParser` that implements a more-sane variant of
the magical interpolation feature. This implementation is more predictable as
well. New applications should prefer this version if they don't need to be
compatible with older versions of Python.
@@ -215,7 +215,7 @@
.. data:: MAX_INTERPOLATION_DEPTH
The maximum depth for recursive interpolation for :meth:`get` when the *raw*
- parameter is false. This is relevant only for the :class:`ConfigParser` class.
+ parameter is false. This is relevant only for the :class:`~ConfigParser.ConfigParser` class.
.. seealso::
@@ -279,7 +279,7 @@
list of potential configuration file locations (for example, the current
directory, the user's home directory, and some system-wide directory), and all
existing configuration files in the list will be read. If none of the named
- files exist, the :class:`ConfigParser` instance will contain an empty dataset.
+ files exist, the :class:`~ConfigParser.ConfigParser` instance will contain an empty dataset.
An application which requires initial values to be loaded from a file should
load the required file or files using :meth:`readfp` before calling :meth:`read`
for any optional files::
@@ -338,7 +338,7 @@
If the given section exists, set the given option to the specified value;
otherwise raise :exc:`NoSectionError`. While it is possible to use
- :class:`RawConfigParser` (or :class:`ConfigParser` with *raw* parameters set to
+ :class:`RawConfigParser` (or :class:`~ConfigParser.ConfigParser` with *raw* parameters set to
true) for *internal* storage of non-string values, full functionality (including
interpolation and output to files) can only be achieved using string values.
@@ -394,7 +394,7 @@
ConfigParser Objects
--------------------
-The :class:`ConfigParser` class extends some methods of the
+The :class:`~ConfigParser.ConfigParser` class extends some methods of the
:class:`RawConfigParser` interface, adding some optional arguments.
@@ -422,7 +422,7 @@
------------------------
The :class:`SafeConfigParser` class implements the same extended interface as
-:class:`ConfigParser`, with the following addition:
+:class:`~ConfigParser.ConfigParser`, with the following addition:
.. method:: SafeConfigParser.set(section, option, value)
@@ -480,7 +480,7 @@
if config.getboolean('Section1', 'a_bool'):
print config.get('Section1', 'foo')
-To get interpolation, you will need to use a :class:`ConfigParser` or
+To get interpolation, you will need to use a :class:`~ConfigParser.ConfigParser` or
:class:`SafeConfigParser`::
import ConfigParser
diff --git a/Doc/library/cookie.rst b/Doc/library/cookie.rst
--- a/Doc/library/cookie.rst
+++ b/Doc/library/cookie.rst
@@ -82,11 +82,11 @@
The same security warning from :class:`SerialCookie` applies here.
A further security note is warranted. For backwards compatibility, the
-:mod:`Cookie` module exports a class named :class:`Cookie` which is just an
-alias for :class:`SmartCookie`. This is probably a mistake and will likely be
-removed in a future version. You should not use the :class:`Cookie` class in
-your applications, for the same reason why you should not use the
-:class:`SerialCookie` class.
+:mod:`Cookie` module exports a class named :class:`~Cookie.Cookie` which is
+just an alias for :class:`SmartCookie`. This is probably a mistake and will
+likely be removed in a future version. You should not use the
+:class:`~Cookie.Cookie` class in your applications, for the same reason why
+you should not use the :class:`SerialCookie` class.
.. seealso::
diff --git a/Doc/library/cookielib.rst b/Doc/library/cookielib.rst
--- a/Doc/library/cookielib.rst
+++ b/Doc/library/cookielib.rst
@@ -100,7 +100,7 @@
1) are treated according to the RFC 2965 rules. However, if RFC 2965 handling
is turned off or :attr:`rfc2109_as_netscape` is ``True``, RFC 2109 cookies are
'downgraded' by the :class:`CookieJar` instance to Netscape cookies, by
- setting the :attr:`version` attribute of the :class:`Cookie` instance to 0.
+ setting the :attr:`version` attribute of the :class:`~cookielib.Cookie` instance to 0.
:class:`DefaultCookiePolicy` also provides some parameters to allow some
fine-tuning of policy.
@@ -108,7 +108,7 @@
.. class:: Cookie()
This class represents Netscape, RFC 2109 and RFC 2965 cookies. It is not
- expected that users of :mod:`cookielib` construct their own :class:`Cookie`
+ expected that users of :mod:`cookielib` construct their own :class:`~cookielib.Cookie`
instances. Instead, if necessary, call :meth:`make_cookies` on a
:class:`CookieJar` instance.
@@ -146,7 +146,7 @@
-----------------------------------
:class:`CookieJar` objects support the :term:`iterator` protocol for iterating over
-contained :class:`Cookie` objects.
+contained :class:`~cookielib.Cookie` objects.
:class:`CookieJar` has the following methods:
@@ -194,7 +194,7 @@
.. method:: CookieJar.make_cookies(response, request)
- Return sequence of :class:`Cookie` objects extracted from *response* object.
+ Return sequence of :class:`~cookielib.Cookie` objects extracted from *response* object.
See the documentation for :meth:`extract_cookies` for the interfaces required of
the *response* and *request* arguments.
@@ -202,12 +202,12 @@
.. method:: CookieJar.set_cookie_if_ok(cookie, request)
- Set a :class:`Cookie` if policy says it's OK to do so.
+ Set a :class:`~cookielib.Cookie` if policy says it's OK to do so.
.. method:: CookieJar.set_cookie(cookie)
- Set a :class:`Cookie`, without checking with policy to see whether or not it
+ Set a :class:`~cookielib.Cookie`, without checking with policy to see whether or not it
should be set.
@@ -383,7 +383,7 @@
:meth:`path_return_ok` is called for the cookie path. Otherwise,
:meth:`path_return_ok` and :meth:`return_ok` are never called for that cookie
domain. If :meth:`path_return_ok` returns true, :meth:`return_ok` is called
- with the :class:`Cookie` object itself for a full check. Otherwise,
+ with the :class:`~cookielib.Cookie` object itself for a full check. Otherwise,
:meth:`return_ok` is never called for that cookie path.
Note that :meth:`domain_return_ok` is called for every *cookie* domain, not just
@@ -516,7 +516,7 @@
If true, request that the :class:`CookieJar` instance downgrade RFC 2109 cookies
(ie. cookies received in a :mailheader:`Set-Cookie` header with a version
cookie-attribute of 1) to Netscape cookies by setting the version attribute of
- the :class:`Cookie` instance to 0. The default value is :const:`None`, in which
+ the :class:`~cookielib.Cookie` instance to 0. The default value is :const:`None`, in which
case RFC 2109 cookies are downgraded if and only if RFC 2965 handling is turned
off. Therefore, RFC 2109 cookies are downgraded by default.
@@ -608,7 +608,7 @@
Cookie Objects
--------------
-:class:`Cookie` instances have Python attributes roughly corresponding to the
+:class:`~cookielib.Cookie` instances have Python attributes roughly corresponding to the
standard cookie-attributes specified in the various cookie standards. The
correspondence is not one-to-one, because there are complicated rules for
assigning default values, because the ``max-age`` and ``expires``
@@ -724,7 +724,7 @@
Set the value of the named cookie-attribute.
-The :class:`Cookie` class also defines the following method:
+The :class:`~cookielib.Cookie` class also defines the following method:
.. method:: Cookie.is_expired([now=None])
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -1170,8 +1170,8 @@
.. _datetime-time:
-:class:`time` Objects
----------------------
+:class:`.time` Objects
+----------------------
A time object represents a (local) time of day, independent of any particular
day, and subject to adjustment via a :class:`tzinfo` object.
diff --git a/Doc/library/docxmlrpcserver.rst b/Doc/library/docxmlrpcserver.rst
--- a/Doc/library/docxmlrpcserver.rst
+++ b/Doc/library/docxmlrpcserver.rst
@@ -16,7 +16,7 @@
The :mod:`DocXMLRPCServer` module extends the classes found in
:mod:`SimpleXMLRPCServer` to serve HTML documentation in response to HTTP GET
-requests. Servers can either be free standing, using :class:`DocXMLRPCServer`,
+requests. Servers can either be free standing, using :class:`~DocXMLRPCServer.DocXMLRPCServer`,
or embedded in a CGI environment, using :class:`DocCGIXMLRPCRequestHandler`.
@@ -36,7 +36,7 @@
Create a new request handler instance. This request handler supports XML-RPC
POST requests, documentation GET requests, and modifies logging so that the
- *logRequests* parameter to the :class:`DocXMLRPCServer` constructor parameter is
+ *logRequests* parameter to the :class:`~DocXMLRPCServer.DocXMLRPCServer` constructor parameter is
honored.
@@ -45,7 +45,7 @@
DocXMLRPCServer Objects
-----------------------
-The :class:`DocXMLRPCServer` class is derived from
+The :class:`~DocXMLRPCServer.DocXMLRPCServer` class is derived from
:class:`SimpleXMLRPCServer.SimpleXMLRPCServer` and provides a means of creating
self-documenting, stand alone XML-RPC servers. HTTP POST requests are handled as
XML-RPC method calls. HTTP GET requests are handled by generating pydoc-style
diff --git a/Doc/library/dumbdbm.rst b/Doc/library/dumbdbm.rst
--- a/Doc/library/dumbdbm.rst
+++ b/Doc/library/dumbdbm.rst
@@ -82,7 +82,7 @@
---------------
In addition to the methods provided by the :class:`UserDict.DictMixin` class,
-:class:`dumbdbm` objects provide the following methods.
+:class:`~dumbdbm.dumbdbm` objects provide the following methods.
.. method:: dumbdbm.sync()
diff --git a/Doc/library/formatter.rst b/Doc/library/formatter.rst
--- a/Doc/library/formatter.rst
+++ b/Doc/library/formatter.rst
@@ -9,7 +9,7 @@
.. index:: single: HTMLParser (class in htmllib)
This module supports two interface definitions, each with multiple
-implementations. The *formatter* interface is used by the :class:`HTMLParser`
+implementations. The *formatter* interface is used by the :class:`~HTMLParser.HTMLParser`
class of the :mod:`htmllib` module, and the *writer* interface is required by
the formatter interface.
diff --git a/Doc/library/gzip.rst b/Doc/library/gzip.rst
--- a/Doc/library/gzip.rst
+++ b/Doc/library/gzip.rst
@@ -67,7 +67,7 @@
*fileobj*, since you might wish to append more material after the compressed
data. This also allows you to pass a :class:`~StringIO.StringIO` object opened for
writing as *fileobj*, and retrieve the resulting memory buffer using the
- :class:`StringIO` object's :meth:`~StringIO.StringIO.getvalue` method.
+ :class:`~StringIO.StringIO` object's :meth:`~StringIO.StringIO.getvalue` method.
:class:`GzipFile` supports iteration and the :keyword:`with` statement.
diff --git a/Doc/library/htmllib.rst b/Doc/library/htmllib.rst
--- a/Doc/library/htmllib.rst
+++ b/Doc/library/htmllib.rst
@@ -24,11 +24,11 @@
formatted in the HyperText Mark-up Language (HTML). The class is not directly
concerned with I/O --- it must be provided with input in string form via a
method, and makes calls to methods of a "formatter" object in order to produce
-output. The :class:`HTMLParser` class is designed to be used as a base class
+output. The :class:`~HTMLParser.HTMLParser` class is designed to be used as a base class
for other classes in order to add functionality, and allows most of its methods
to be extended or overridden. In turn, this class is derived from and extends
the :class:`SGMLParser` class defined in module :mod:`sgmllib`. The
-:class:`HTMLParser` implementation supports the HTML 2.0 language as described
+:class:`~HTMLParser.HTMLParser` implementation supports the HTML 2.0 language as described
in :rfc:`1866`. Two implementations of formatter objects are provided in the
:mod:`formatter` module; refer to the documentation for that module for
information on the formatter interface.
@@ -70,7 +70,7 @@
.. exception:: HTMLParseError
- Exception raised by the :class:`HTMLParser` class when it encounters an error
+ Exception raised by the :class:`~HTMLParser.HTMLParser` class when it encounters an error
while parsing.
.. versionadded:: 2.4
@@ -91,7 +91,7 @@
Definition of replacement text for XHTML 1.0 entities.
Module :mod:`sgmllib`
- Base class for :class:`HTMLParser`.
+ Base class for :class:`~HTMLParser.HTMLParser`.
.. _html-parser-objects:
@@ -99,7 +99,7 @@
HTMLParser Objects
------------------
-In addition to tag methods, the :class:`HTMLParser` class provides some
+In addition to tag methods, the :class:`~HTMLParser.HTMLParser` class provides some
additional methods and instance variables for use within tag methods.
@@ -173,7 +173,7 @@
This module defines three dictionaries, ``name2codepoint``, ``codepoint2name``,
and ``entitydefs``. ``entitydefs`` is used by the :mod:`htmllib` module to
-provide the :attr:`entitydefs` attribute of the :class:`HTMLParser` class. The
+provide the :attr:`entitydefs` attribute of the :class:`~HTMLParser.HTMLParser` class. The
definition provided here contains all the entities defined by XHTML 1.0 that
can be handled using simple textual substitution in the Latin-1 character set
(ISO-8859-1).
diff --git a/Doc/library/io.rst b/Doc/library/io.rst
--- a/Doc/library/io.rst
+++ b/Doc/library/io.rst
@@ -47,7 +47,7 @@
streams whose bytes represent text, and handles encoding and decoding
from and to :class:`unicode` strings. :class:`TextIOWrapper`, which extends
it, is a buffered text interface to a buffered raw stream
-(:class:`BufferedIOBase`). Finally, :class:`StringIO` is an in-memory
+(:class:`BufferedIOBase`). Finally, :class:`~io.StringIO` is an in-memory
stream for unicode text.
Argument names are not part of the specification, and only the arguments of
@@ -180,7 +180,7 @@
It is also possible to use an :class:`unicode` or :class:`bytes` string
as a file for both reading and writing. For :class:`unicode` strings
- :class:`StringIO` can be used like a file opened in text mode,
+ :class:`~io.StringIO` can be used like a file opened in text mode,
and for :class:`bytes` a :class:`BytesIO` can be used like a
file opened in a binary mode.
@@ -718,7 +718,7 @@
After the underlying buffer has been detached, the :class:`TextIOBase` is
in an unusable state.
- Some :class:`TextIOBase` implementations, like :class:`StringIO`, may not
+ Some :class:`TextIOBase` implementations, like :class:`~io.StringIO`, may not
have the concept of an underlying buffer and calling this method will
raise :exc:`UnsupportedOperation`.
@@ -834,13 +834,13 @@
newlines are written as ``\n`` on all platforms, but universal
newline decoding is still performed when reading.
- :class:`StringIO` provides this method in addition to those from
+ :class:`~io.StringIO` provides this method in addition to those from
:class:`TextIOWrapper` and its parents:
.. method:: getvalue()
Return a ``unicode`` containing the entire contents of the buffer at any
- time before the :class:`StringIO` object's :meth:`close` method is
+ time before the :class:`~io.StringIO` object's :meth:`close` method is
called. Newlines are decoded as if by :meth:`~TextIOBase.read`,
although the stream position is not changed.
@@ -902,7 +902,7 @@
Also, :meth:`TextIOWrapper.tell` and :meth:`TextIOWrapper.seek` are both
quite slow due to the reconstruction algorithm used.
-:class:`StringIO`, however, is a native in-memory unicode container and will
+:class:`~io.StringIO`, however, is a native in-memory unicode container and will
exhibit similar speed to :class:`BytesIO`.
Multi-threading
diff --git a/Doc/library/mimewriter.rst b/Doc/library/mimewriter.rst
--- a/Doc/library/mimewriter.rst
+++ b/Doc/library/mimewriter.rst
@@ -12,17 +12,17 @@
The :mod:`email` package should be used in preference to the :mod:`MimeWriter`
module. This module is present only to maintain backward compatibility.
-This module defines the class :class:`MimeWriter`. The :class:`MimeWriter`
+This module defines the class :class:`~MimeWriter.MimeWriter`. The :class:`~MimeWriter.MimeWriter`
class implements a basic formatter for creating MIME multi-part files. It
doesn't seek around the output file nor does it use large amounts of buffer
space. You must write the parts out in the order that they should occur in the
-final file. :class:`MimeWriter` does buffer the headers you add, allowing you
+final file. :class:`~MimeWriter.MimeWriter` does buffer the headers you add, allowing you
to rearrange their order.
.. class:: MimeWriter(fp)
- Return a new instance of the :class:`MimeWriter` class. The only argument
+ Return a new instance of the :class:`~MimeWriter.MimeWriter` class. The only argument
passed, *fp*, is a file object to be used for writing. Note that a
:class:`~StringIO.StringIO` object could also be used.
@@ -32,7 +32,7 @@
MimeWriter Objects
------------------
-:class:`MimeWriter` instances have the following methods:
+:class:`~MimeWriter.MimeWriter` instances have the following methods:
.. method:: MimeWriter.addheader(key, value[, prefix])
@@ -72,7 +72,7 @@
.. method:: MimeWriter.nextpart()
- Returns a new instance of :class:`MimeWriter` which represents an individual
+ Returns a new instance of :class:`~MimeWriter.MimeWriter` which represents an individual
part in a multipart message. This may be used to write the part as well as
used for creating recursively complex multipart messages. The message must first
be initialized with :meth:`startmultipartbody` before using :meth:`nextpart`.
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -15,7 +15,7 @@
also read and write data starting at the current file position, and
:meth:`seek` through the file to different positions.
-A memory-mapped file is created by the :class:`mmap` constructor, which is
+A memory-mapped file is created by the :class:`~mmap.mmap` constructor, which is
different on Unix and on Windows. In either case you must provide a file
descriptor for a file opened for update. If you wish to map an existing Python
file object, use its :meth:`fileno` method to obtain the correct value for the
@@ -77,7 +77,7 @@
**(Unix version)** Maps *length* bytes from the file specified by the file
descriptor *fileno*, and returns a mmap object. If *length* is ``0``, the
maximum length of the map will be the current size of the file when
- :class:`mmap` is called.
+ :class:`~mmap.mmap` is called.
*flags* specifies the nature of the mapping. :const:`MAP_PRIVATE` creates a
private copy-on-write mapping, so changes to the contents of the mmap
@@ -104,7 +104,7 @@
by the descriptor *fileno* is internally automatically synchronized
with physical backing store on Mac OS X and OpenVMS.
- This example shows a simple way of using :class:`mmap`::
+ This example shows a simple way of using :class:`~mmap.mmap`::
import mmap
diff --git a/Doc/library/mutex.rst b/Doc/library/mutex.rst
--- a/Doc/library/mutex.rst
+++ b/Doc/library/mutex.rst
@@ -40,7 +40,7 @@
Mutex Objects
-------------
-:class:`mutex` objects have following methods:
+:class:`~mutex.mutex` objects have following methods:
.. method:: mutex.test()
diff --git a/Doc/library/netrc.rst b/Doc/library/netrc.rst
--- a/Doc/library/netrc.rst
+++ b/Doc/library/netrc.rst
@@ -14,13 +14,13 @@
--------------
-The :class:`netrc` class parses and encapsulates the netrc file format used by
+The :class:`~netrc.netrc` class parses and encapsulates the netrc file format used by
the Unix :program:`ftp` program and other FTP clients.
.. class:: netrc([file])
- A :class:`netrc` instance or subclass instance encapsulates data from a netrc
+ A :class:`~netrc.netrc` instance or subclass instance encapsulates data from a netrc
file. The initialization argument, if present, specifies the file to parse. If
no argument is given, the file :file:`.netrc` in the user's home directory will
be read. Parse errors will raise :exc:`NetrcParseError` with diagnostic
@@ -37,7 +37,7 @@
.. exception:: NetrcParseError
- Exception raised by the :class:`netrc` class when syntactical errors are
+ Exception raised by the :class:`~netrc.netrc` class when syntactical errors are
encountered in source text. Instances of this exception provide three
interesting attributes: :attr:`msg` is a textual explanation of the error,
:attr:`filename` is the name of the source file, and :attr:`lineno` gives the
@@ -49,7 +49,7 @@
netrc Objects
-------------
-A :class:`netrc` instance has the following methods:
+A :class:`~netrc.netrc` instance has the following methods:
.. method:: netrc.authenticators(host)
@@ -65,7 +65,7 @@
Dump the class data as a string in the format of a netrc file. (This discards
comments and may reorder the entries.)
-Instances of :class:`netrc` have public instance variables:
+Instances of :class:`~netrc.netrc` have public instance variables:
.. attribute:: netrc.hosts
diff --git a/Doc/library/queue.rst b/Doc/library/queue.rst
--- a/Doc/library/queue.rst
+++ b/Doc/library/queue.rst
@@ -15,7 +15,7 @@
The :mod:`Queue` module implements multi-producer, multi-consumer queues.
It is especially useful in threaded programming when information must be
-exchanged safely between multiple threads. The :class:`Queue` class in this
+exchanged safely between multiple threads. The :class:`~Queue.Queue` class in this
module implements all the required locking semantics. It depends on the
availability of thread support in Python; see the :mod:`threading`
module.
@@ -62,14 +62,14 @@
Exception raised when non-blocking :meth:`~Queue.get` (or
:meth:`~Queue.get_nowait`) is called
- on a :class:`Queue` object which is empty.
+ on a :class:`~Queue.Queue` object which is empty.
.. exception:: Full
Exception raised when non-blocking :meth:`~Queue.put` (or
:meth:`~Queue.put_nowait`) is called
- on a :class:`Queue` object which is full.
+ on a :class:`~Queue.Queue` object which is full.
.. seealso::
@@ -83,7 +83,7 @@
Queue Objects
-------------
-Queue objects (:class:`Queue`, :class:`LifoQueue`, or :class:`PriorityQueue`)
+Queue objects (:class:`~Queue.Queue`, :class:`LifoQueue`, or :class:`PriorityQueue`)
provide the public methods described below.
diff --git a/Doc/library/scrolledtext.rst b/Doc/library/scrolledtext.rst
--- a/Doc/library/scrolledtext.rst
+++ b/Doc/library/scrolledtext.rst
@@ -9,7 +9,7 @@
The :mod:`ScrolledText` module provides a class of the same name which
implements a basic text widget which has a vertical scroll bar configured to do
-the "right thing." Using the :class:`ScrolledText` class is a lot easier than
+the "right thing." Using the :class:`~ScrolledText.ScrolledText` class is a lot easier than
setting up a text widget and scroll bar directly. The constructor is the same
as that of the :class:`Tkinter.Text` class.
@@ -21,7 +21,7 @@
The text widget and scrollbar are packed together in a :class:`Frame`, and the
methods of the :class:`Grid` and :class:`Pack` geometry managers are acquired
-from the :class:`Frame` object. This allows the :class:`ScrolledText` widget to
+from the :class:`Frame` object. This allows the :class:`~ScrolledText.ScrolledText` widget to
be used directly to achieve most normal geometry management behavior.
Should more specific control be necessary, the following attributes are
diff --git a/Doc/library/simplexmlrpcserver.rst b/Doc/library/simplexmlrpcserver.rst
--- a/Doc/library/simplexmlrpcserver.rst
+++ b/Doc/library/simplexmlrpcserver.rst
@@ -20,7 +20,7 @@
The :mod:`SimpleXMLRPCServer` module provides a basic server framework for
XML-RPC servers written in Python. Servers can either be free standing, using
-:class:`SimpleXMLRPCServer`, or embedded in a CGI environment, using
+:class:`~SimpleXMLRPCServer.SimpleXMLRPCServer`, or embedded in a CGI environment, using
:class:`CGIXMLRPCRequestHandler`.
@@ -62,7 +62,7 @@
Create a new request handler instance. This request handler supports ``POST``
requests and modifies logging so that the *logRequests* parameter to the
- :class:`SimpleXMLRPCServer` constructor parameter is honored.
+ :class:`~SimpleXMLRPCServer.SimpleXMLRPCServer` constructor parameter is honored.
.. _simple-xmlrpc-servers:
@@ -70,7 +70,7 @@
SimpleXMLRPCServer Objects
--------------------------
-The :class:`SimpleXMLRPCServer` class is based on
+The :class:`~SimpleXMLRPCServer.SimpleXMLRPCServer` class is based on
:class:`SocketServer.TCPServer` and provides a means of creating simple, stand
alone XML-RPC servers.
@@ -197,7 +197,7 @@
# Print list of available methods
print s.system.listMethods()
-The following :class:`SimpleXMLRPCServer` example is included in the module
+The following :class:`~SimpleXMLRPCServer.SimpleXMLRPCServer` example is included in the module
`Lib/SimpleXMLRPCServer.py`::
server = SimpleXMLRPCServer(("localhost", 8000))
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -835,7 +835,7 @@
:meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument instead.
Socket objects also have these (read-only) attributes that correspond to the
-values given to the :class:`socket` constructor.
+values given to the :class:`~socket.socket` constructor.
.. attribute:: socket.family
diff --git a/Doc/library/stringio.rst b/Doc/library/stringio.rst
--- a/Doc/library/stringio.rst
+++ b/Doc/library/stringio.rst
@@ -6,7 +6,7 @@
:synopsis: Read and write strings as if they were files.
-This module implements a file-like class, :class:`StringIO`, that reads and
+This module implements a file-like class, :class:`~StringIO.StringIO`, that reads and
writes a string buffer (also known as *memory files*). See the description of
file objects for operations (section :ref:`bltin-file-objects`). (For
standard strings, see :class:`str` and :class:`unicode`.)
@@ -14,23 +14,23 @@
.. class:: StringIO([buffer])
- When a :class:`StringIO` object is created, it can be initialized to an existing
+ When a :class:`~StringIO.StringIO` object is created, it can be initialized to an existing
string by passing the string to the constructor. If no string is given, the
- :class:`StringIO` will start empty. In both cases, the initial file position
+ :class:`~StringIO.StringIO` will start empty. In both cases, the initial file position
starts at zero.
- The :class:`StringIO` object can accept either Unicode or 8-bit strings, but
+ The :class:`~StringIO.StringIO` object can accept either Unicode or 8-bit strings, but
mixing the two may take some care. If both are used, 8-bit strings that cannot
be interpreted as 7-bit ASCII (that use the 8th bit) will cause a
:exc:`UnicodeError` to be raised when :meth:`getvalue` is called.
-The following methods of :class:`StringIO` objects require special mention:
+The following methods of :class:`~StringIO.StringIO` objects require special mention:
.. method:: StringIO.getvalue()
Retrieve the entire contents of the "file" at any time before the
- :class:`StringIO` object's :meth:`close` method is called. See the note above
+ :class:`~StringIO.StringIO` object's :meth:`close` method is called. See the note above
for information about mixing Unicode and 8-bit strings; such mixing can cause
this method to raise :exc:`UnicodeError`.
@@ -38,7 +38,7 @@
.. method:: StringIO.close()
Free the memory buffer. Attempting to do further operations with a closed
- :class:`StringIO` object will raise a :exc:`ValueError`.
+ :class:`~StringIO.StringIO` object will raise a :exc:`ValueError`.
Example usage::
diff --git a/Doc/library/userdict.rst b/Doc/library/userdict.rst
--- a/Doc/library/userdict.rst
+++ b/Doc/library/userdict.rst
@@ -14,15 +14,15 @@
simplifies writing classes that need to be substitutable for dictionaries (such
as the shelve module).
-This module also defines a class, :class:`UserDict`, that acts as a wrapper
+This module also defines a class, :class:`~UserDict.UserDict`, that acts as a wrapper
around dictionary objects. The need for this class has been largely supplanted
by the ability to subclass directly from :class:`dict` (a feature that became
available starting with Python version 2.2). Prior to the introduction of
-:class:`dict`, the :class:`UserDict` class was used to create dictionary-like
+:class:`dict`, the :class:`~UserDict.UserDict` class was used to create dictionary-like
sub-classes that obtained new behaviors by overriding existing methods or adding
new ones.
-The :mod:`UserDict` module defines the :class:`UserDict` class and
+The :mod:`UserDict` module defines the :class:`~UserDict.UserDict` class and
:class:`DictMixin`:
@@ -30,28 +30,28 @@
Class that simulates a dictionary. The instance's contents are kept in a
regular dictionary, which is accessible via the :attr:`data` attribute of
- :class:`UserDict` instances. If *initialdata* is provided, :attr:`data` is
+ :class:`~UserDict.UserDict` instances. If *initialdata* is provided, :attr:`data` is
initialized with its contents; note that a reference to *initialdata* will not
be kept, allowing it be used for other purposes.
.. note::
- For backward compatibility, instances of :class:`UserDict` are not iterable.
+ For backward compatibility, instances of :class:`~UserDict.UserDict` are not iterable.
.. class:: IterableUserDict([initialdata])
- Subclass of :class:`UserDict` that supports direct iteration (e.g. ``for key in
+ Subclass of :class:`~UserDict.UserDict` that supports direct iteration (e.g. ``for key in
myDict``).
In addition to supporting the methods and operations of mappings (see section
-:ref:`typesmapping`), :class:`UserDict` and :class:`IterableUserDict` instances
+:ref:`typesmapping`), :class:`~UserDict.UserDict` and :class:`IterableUserDict` instances
provide the following attribute:
.. attribute:: IterableUserDict.data
- A real dictionary used to store the contents of the :class:`UserDict` class.
+ A real dictionary used to store the contents of the :class:`~UserDict.UserDict` class.
.. class:: DictMixin()
@@ -96,7 +96,7 @@
In addition, this class can be mixed-in with built-in classes using multiple
inheritance. This can sometimes be useful. For example, you can inherit
- from :class:`UserList` and :class:`str` at the same time. That would not be
+ from :class:`~UserList.UserList` and :class:`str` at the same time. That would not be
possible with both a real :class:`list` and a real :class:`str`.
This module defines a class that acts as a wrapper around list objects. It is a
@@ -104,34 +104,34 @@
and override existing methods or add new ones. In this way one can add new
behaviors to lists.
-The :mod:`UserList` module defines the :class:`UserList` class:
+The :mod:`UserList` module defines the :class:`~UserList.UserList` class:
.. class:: UserList([list])
Class that simulates a list. The instance's contents are kept in a regular
- list, which is accessible via the :attr:`data` attribute of :class:`UserList`
+ list, which is accessible via the :attr:`data` attribute of :class:`~UserList.UserList`
instances. The instance's contents are initially set to a copy of *list*,
defaulting to the empty list ``[]``. *list* can be any iterable, e.g. a
- real Python list or a :class:`UserList` object.
+ real Python list or a :class:`~UserList.UserList` object.
.. note::
- The :class:`UserList` class has been moved to the :mod:`collections`
+ The :class:`~UserList.UserList` class has been moved to the :mod:`collections`
module in Python 3. The :term:`2to3` tool will automatically adapt
imports when converting your sources to Python 3.
In addition to supporting the methods and operations of mutable sequences (see
-section :ref:`typesseq`), :class:`UserList` instances provide the following
+section :ref:`typesseq`), :class:`~UserList.UserList` instances provide the following
attribute:
.. attribute:: UserList.data
- A real Python list object used to store the contents of the :class:`UserList`
+ A real Python list object used to store the contents of the :class:`~UserList.UserList`
class.
-**Subclassing requirements:** Subclasses of :class:`UserList` are expected to
+**Subclassing requirements:** Subclasses of :class:`~UserList.UserList` are expected to
offer a constructor which can be called with either no arguments or one
argument. List operations which return a new sequence attempt to create an
instance of the actual implementation class. To do so, it assumes that the
@@ -160,10 +160,10 @@
.. note::
- This :class:`UserString` class from this module is available for backward
+ This :class:`~UserString.UserString` class from this module is available for backward
compatibility only. If you are writing code that does not need to work with
versions of Python earlier than Python 2.2, please consider subclassing directly
- from the built-in :class:`str` type instead of using :class:`UserString` (there
+ from the built-in :class:`str` type instead of using :class:`~UserString.UserString` (there
is no built-in equivalent to :class:`MutableString`).
This module defines a class that acts as a wrapper around string objects. It is
@@ -182,14 +182,14 @@
Class that simulates a string or a Unicode string object. The instance's
content is kept in a regular string or Unicode string object, which is
- accessible via the :attr:`data` attribute of :class:`UserString` instances. The
+ accessible via the :attr:`data` attribute of :class:`~UserString.UserString` instances. The
instance's contents are initially set to a copy of *sequence*. *sequence* can
be either a regular Python string or Unicode string, an instance of
- :class:`UserString` (or a subclass) or an arbitrary sequence which can be
+ :class:`~UserString.UserString` (or a subclass) or an arbitrary sequence which can be
converted into a string using the built-in :func:`str` function.
.. note::
- The :class:`UserString` class has been moved to the :mod:`collections`
+ The :class:`~UserString.UserString` class has been moved to the :mod:`collections`
module in Python 3. The :term:`2to3` tool will automatically adapt
imports when converting your sources to Python 3.
@@ -197,7 +197,7 @@
.. class:: MutableString([sequence])
- This class is derived from the :class:`UserString` above and redefines strings
+ This class is derived from the :class:`~UserString.UserString` above and redefines strings
to be *mutable*. Mutable strings can't be used as dictionary keys, because
dictionaries require *immutable* objects as keys. The main intention of this
class is to serve as an educational example for inheritance and necessity to
@@ -209,12 +209,12 @@
The :class:`MutableString` class has been removed in Python 3.
In addition to supporting the methods and operations of string and Unicode
-objects (see section :ref:`string-methods`), :class:`UserString` instances
+objects (see section :ref:`string-methods`), :class:`~UserString.UserString` instances
provide the following attribute:
.. attribute:: MutableString.data
A real Python string or Unicode object used to store the content of the
- :class:`UserString` class.
+ :class:`~UserString.UserString` class.
diff --git a/Doc/whatsnew/2.1.rst b/Doc/whatsnew/2.1.rst
--- a/Doc/whatsnew/2.1.rst
+++ b/Doc/whatsnew/2.1.rst
@@ -445,7 +445,7 @@
:attr:`~object.__dict__`. Unlike the :attr:`~object.__dict__` attribute of class instances, in
functions you can actually assign a new dictionary to :attr:`~object.__dict__`, though
the new value is restricted to a regular Python dictionary; you *can't* be
-tricky and set it to a :class:`UserDict` instance, or any other random object
+tricky and set it to a :class:`~UserDict.UserDict` instance, or any other random object
that behaves like a mapping.
diff --git a/Doc/whatsnew/2.2.rst b/Doc/whatsnew/2.2.rst
--- a/Doc/whatsnew/2.2.rst
+++ b/Doc/whatsnew/2.2.rst
@@ -55,7 +55,7 @@
so you can't just subclass, say, lists in order to add a single useful method to
them. The :mod:`UserList` module provides a class that supports all of the
methods of lists and that can be subclassed further, but there's lots of C code
-that expects a regular Python list and won't accept a :class:`UserList`
+that expects a regular Python list and won't accept a :class:`~UserList.UserList`
instance.
Python 2.2 fixes this, and in the process adds some exciting new capabilities.
diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst
--- a/Doc/whatsnew/2.3.rst
+++ b/Doc/whatsnew/2.3.rst
@@ -1683,13 +1683,13 @@
fancy features, and just stick to the basics of representing time.
The three primary types are: :class:`date`, representing a day, month, and year;
-:class:`time`, consisting of hour, minute, and second; and :class:`datetime`,
-which contains all the attributes of both :class:`date` and :class:`time`.
+:class:`~datetime.time`, consisting of hour, minute, and second; and :class:`~datetime.datetime`,
+which contains all the attributes of both :class:`date` and :class:`~datetime.time`.
There's also a :class:`timedelta` class representing differences between two
points in time, and time zone logic is implemented by classes inheriting from
the abstract :class:`tzinfo` class.
-You can create instances of :class:`date` and :class:`time` by either supplying
+You can create instances of :class:`date` and :class:`~datetime.time` by either supplying
keyword arguments to the appropriate constructor, e.g.
``datetime.date(year=1972, month=10, day=15)``, or by using one of a number of
class methods. For example, the :meth:`date.today` class method returns the
@@ -1708,7 +1708,7 @@
'2002 30 Dec'
The :meth:`replace` method allows modifying one or more fields of a
-:class:`date` or :class:`datetime` instance, returning a new instance::
+:class:`date` or :class:`~datetime.datetime` instance, returning a new instance::
>>> d = datetime.datetime.now()
>>> d
@@ -1718,11 +1718,11 @@
>>>
Instances can be compared, hashed, and converted to strings (the result is the
-same as that of :meth:`isoformat`). :class:`date` and :class:`datetime`
+same as that of :meth:`isoformat`). :class:`date` and :class:`~datetime.datetime`
instances can be subtracted from each other, and added to :class:`timedelta`
instances. The largest missing feature is that there's no standard library
support for parsing strings and getting back a :class:`date` or
-:class:`datetime`.
+:class:`~datetime.datetime`.
For more information, refer to the module's reference documentation.
(Contributed by Tim Peters.)
diff --git a/Doc/whatsnew/2.4.rst b/Doc/whatsnew/2.4.rst
--- a/Doc/whatsnew/2.4.rst
+++ b/Doc/whatsnew/2.4.rst
@@ -1523,7 +1523,7 @@
empty list instead of raising a :exc:`TypeError` exception if called with no
arguments.
-* You can no longer compare the :class:`date` and :class:`datetime` instances
+* You can no longer compare the :class:`date` and :class:`~datetime.datetime` instances
provided by the :mod:`datetime` module. Two instances of different classes
will now always be unequal, and relative comparisons (``<``, ``>``) will raise
a :exc:`TypeError`.
diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst
--- a/Doc/whatsnew/2.5.rst
+++ b/Doc/whatsnew/2.5.rst
@@ -1307,7 +1307,7 @@
(Contributed by Skip Montanaro and Andrew McNamara.)
-* The :class:`datetime` class in the :mod:`datetime` module now has a
+* The :class:`~datetime.datetime` class in the :mod:`datetime` module now has a
:meth:`strptime(string, format)` method for parsing date strings, contributed
by Josh Spoerri. It uses the same format characters as :func:`time.strptime` and
:func:`time.strftime`::
@@ -1497,7 +1497,7 @@
* The :mod:`pyexpat` module now uses version 2.0 of the Expat parser.
(Contributed by Trent Mick.)
-* The :class:`Queue` class provided by the :mod:`Queue` module gained two new
+* The :class:`~Queue.Queue` class provided by the :mod:`Queue` module gained two new
methods. :meth:`join` blocks until all items in the queue have been retrieved
and all processing work on the items have been completed. Worker threads call
the other new method, :meth:`task_done`, to signal that processing for an item
@@ -1649,7 +1649,7 @@
.. Patch #754022
-* The :mod:`xmlrpclib` module now supports returning :class:`datetime` objects
+* The :mod:`xmlrpclib` module now supports returning :class:`~datetime.datetime` objects
for the XML-RPC date type. Supply ``use_datetime=True`` to the :func:`loads`
function or the :class:`Unmarshaller` class to enable this feature. (Contributed
by Skip Montanaro.)
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -609,10 +609,10 @@
result = queue.get()
print 'Factorial', N, '=', result
-A :class:`Queue` is used to communicate the result of the factorial.
-The :class:`Queue` object is stored in a global variable.
+A :class:`~Queue.Queue` is used to communicate the result of the factorial.
+The :class:`~Queue.Queue` object is stored in a global variable.
The child process will use the value of the variable when the child
-was created; because it's a :class:`Queue`, parent and child can use
+was created; because it's a :class:`~Queue.Queue`, parent and child can use
the object to communicate. (If the parent were to change the value of
the global variable, the child's value would be unaffected, and vice
versa.)
@@ -1077,7 +1077,7 @@
There are two concrete implementations. :class:`TextIOWrapper`
wraps a buffered I/O object, supporting all of the methods for
text I/O and adding a :attr:`buffer` attribute for access
- to the underlying object. :class:`StringIO` simply buffers
+ to the underlying object. :class:`~StringIO.StringIO` simply buffers
everything in memory without ever writing anything to disk.
(In Python 2.6, :class:`io.StringIO` is implemented in
@@ -2127,7 +2127,7 @@
(Contributed by Christian Heimes and Mark Dickinson.)
-* :class:`mmap` objects now have a :meth:`rfind` method that searches for a
+* :class:`~mmap.mmap` objects now have a :meth:`rfind` method that searches for a
substring beginning at the end of the string and searching
backwards. The :meth:`find` method also gained an *end* parameter
giving an index at which to stop searching.
@@ -2605,7 +2605,7 @@
intended for testing purposes that lets you temporarily modify the
warning filters and then restore their original values (:issue:`3781`).
-* The XML-RPC :class:`SimpleXMLRPCServer` and :class:`DocXMLRPCServer`
+* The XML-RPC :class:`~SimpleXMLRPCServer.SimpleXMLRPCServer` and :class:`~DocXMLRPCServer.DocXMLRPCServer`
classes can now be prevented from immediately opening and binding to
their socket by passing True as the ``bind_and_activate``
constructor parameter. This can be used to modify the instance's
@@ -2614,7 +2614,7 @@
open the socket and begin listening for connections.
(Contributed by Peter Parente; :issue:`1599845`.)
- :class:`SimpleXMLRPCServer` also has a :attr:`_send_traceback_header`
+ :class:`~SimpleXMLRPCServer.SimpleXMLRPCServer` also has a :attr:`_send_traceback_header`
attribute; if true, the exception and formatted traceback are returned
as HTTP headers "X-Exception" and "X-Traceback". This feature is
for debugging purposes only and should not be used on production servers
@@ -2626,7 +2626,7 @@
:class:`datetime.date` and :class:`datetime.time` to the
:class:`xmlrpclib.DateTime` type; the conversion semantics were
not necessarily correct for all applications. Code using
- :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
+ :mod:`xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
instances. (:issue:`1330538`) The code can also handle
dates before 1900 (contributed by Ralf Schmitt; :issue:`2014`)
and 64-bit integers represented by using ``<i8>`` in XML-RPC responses
@@ -3279,7 +3279,7 @@
:class:`datetime.date` and :class:`datetime.time` to the
:class:`xmlrpclib.DateTime` type; the conversion semantics were
not necessarily correct for all applications. Code using
- :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
+ :mod:`xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
instances. (:issue:`1330538`)
* (3.0-warning mode) The :class:`Exception` class now warns
--
Repository URL: https://hg.python.org/cpython
1
0
cpython (merge 3.6 -> default): Issue #21818: Fixed references to classes that have names matching with module
by serhiy.storchaka 02 Dec '16
by serhiy.storchaka 02 Dec '16
02 Dec '16
https://hg.python.org/cpython/rev/c642c597d05c
changeset: 105421:c642c597d05c
parent: 105417:dd4c420b8e66
parent: 105420:62c9a89a2103
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Fri Dec 02 23:15:42 2016 +0200
summary:
Issue #21818: Fixed references to classes that have names matching with module
names.
files:
Doc/library/array.rst | 2 +-
Doc/library/datetime.rst | 6 +++---
Doc/library/mmap.rst | 8 ++++----
Doc/library/netrc.rst | 10 +++++-----
Doc/library/socket.rst | 2 +-
Doc/whatsnew/2.3.rst | 12 ++++++------
Doc/whatsnew/2.4.rst | 2 +-
Doc/whatsnew/2.5.rst | 6 +++---
Doc/whatsnew/2.6.rst | 12 ++++++------
9 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/Doc/library/array.rst b/Doc/library/array.rst
--- a/Doc/library/array.rst
+++ b/Doc/library/array.rst
@@ -254,7 +254,7 @@
empty, otherwise it is a string if the *typecode* is ``'u'``, otherwise it is a
list of numbers. The string is guaranteed to be able to be converted back to an
array with the same type and value using :func:`eval`, so long as the
-:func:`array` function has been imported using ``from array import array``.
+:class:`~array.array` class has been imported using ``from array import array``.
Examples::
array('l')
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -1368,8 +1368,8 @@
.. _datetime-time:
-:class:`time` Objects
----------------------
+:class:`.time` Objects
+----------------------
A time object represents a (local) time of day, independent of any particular
day, and subject to adjustment via a :class:`tzinfo` object.
@@ -1466,7 +1466,7 @@
``!=``. The latter cases return :const:`False` or :const:`True`, respectively.
.. versionchanged:: 3.3
- Equality comparisons between naive and aware :class:`time` instances
+ Equality comparisons between naive and aware :class:`~datetime.time` instances
don't raise :exc:`TypeError`.
* hash, use as dict key
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -14,7 +14,7 @@
slice: ``obj[i1:i2] = b'...'``. You can also read and write data starting at
the current file position, and :meth:`seek` through the file to different positions.
-A memory-mapped file is created by the :class:`mmap` constructor, which is
+A memory-mapped file is created by the :class:`~mmap.mmap` constructor, which is
different on Unix and on Windows. In either case you must provide a file
descriptor for a file opened for update. If you wish to map an existing Python
file object, use its :meth:`fileno` method to obtain the correct value for the
@@ -70,7 +70,7 @@
**(Unix version)** Maps *length* bytes from the file specified by the file
descriptor *fileno*, and returns a mmap object. If *length* is ``0``, the
maximum length of the map will be the current size of the file when
- :class:`mmap` is called.
+ :class:`~mmap.mmap` is called.
*flags* specifies the nature of the mapping. :const:`MAP_PRIVATE` creates a
private copy-on-write mapping, so changes to the contents of the mmap
@@ -97,7 +97,7 @@
by the descriptor *fileno* is internally automatically synchronized
with physical backing store on Mac OS X and OpenVMS.
- This example shows a simple way of using :class:`mmap`::
+ This example shows a simple way of using :class:`~mmap.mmap`::
import mmap
@@ -122,7 +122,7 @@
mm.close()
- :class:`mmap` can also be used as a context manager in a :keyword:`with`
+ :class:`~mmap.mmap` can also be used as a context manager in a :keyword:`with`
statement.::
import mmap
diff --git a/Doc/library/netrc.rst b/Doc/library/netrc.rst
--- a/Doc/library/netrc.rst
+++ b/Doc/library/netrc.rst
@@ -12,13 +12,13 @@
--------------
-The :class:`netrc` class parses and encapsulates the netrc file format used by
+The :class:`~netrc.netrc` class parses and encapsulates the netrc file format used by
the Unix :program:`ftp` program and other FTP clients.
.. class:: netrc([file])
- A :class:`netrc` instance or subclass instance encapsulates data from a netrc
+ A :class:`~netrc.netrc` instance or subclass instance encapsulates data from a netrc
file. The initialization argument, if present, specifies the file to parse. If
no argument is given, the file :file:`.netrc` in the user's home directory will
be read. Parse errors will raise :exc:`NetrcParseError` with diagnostic
@@ -35,7 +35,7 @@
.. exception:: NetrcParseError
- Exception raised by the :class:`netrc` class when syntactical errors are
+ Exception raised by the :class:`~netrc.netrc` class when syntactical errors are
encountered in source text. Instances of this exception provide three
interesting attributes: :attr:`msg` is a textual explanation of the error,
:attr:`filename` is the name of the source file, and :attr:`lineno` gives the
@@ -47,7 +47,7 @@
netrc Objects
-------------
-A :class:`netrc` instance has the following methods:
+A :class:`~netrc.netrc` instance has the following methods:
.. method:: netrc.authenticators(host)
@@ -63,7 +63,7 @@
Dump the class data as a string in the format of a netrc file. (This discards
comments and may reorder the entries.)
-Instances of :class:`netrc` have public instance variables:
+Instances of :class:`~netrc.netrc` have public instance variables:
.. attribute:: netrc.hosts
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -1441,7 +1441,7 @@
:meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument instead.
Socket objects also have these (read-only) attributes that correspond to the
-values given to the :class:`socket` constructor.
+values given to the :class:`~socket.socket` constructor.
.. attribute:: socket.family
diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst
--- a/Doc/whatsnew/2.3.rst
+++ b/Doc/whatsnew/2.3.rst
@@ -1683,13 +1683,13 @@
fancy features, and just stick to the basics of representing time.
The three primary types are: :class:`date`, representing a day, month, and year;
-:class:`time`, consisting of hour, minute, and second; and :class:`datetime`,
-which contains all the attributes of both :class:`date` and :class:`time`.
+:class:`~datetime.time`, consisting of hour, minute, and second; and :class:`~datetime.datetime`,
+which contains all the attributes of both :class:`date` and :class:`~datetime.time`.
There's also a :class:`timedelta` class representing differences between two
points in time, and time zone logic is implemented by classes inheriting from
the abstract :class:`tzinfo` class.
-You can create instances of :class:`date` and :class:`time` by either supplying
+You can create instances of :class:`date` and :class:`~datetime.time` by either supplying
keyword arguments to the appropriate constructor, e.g.
``datetime.date(year=1972, month=10, day=15)``, or by using one of a number of
class methods. For example, the :meth:`date.today` class method returns the
@@ -1708,7 +1708,7 @@
'2002 30 Dec'
The :meth:`replace` method allows modifying one or more fields of a
-:class:`date` or :class:`datetime` instance, returning a new instance::
+:class:`date` or :class:`~datetime.datetime` instance, returning a new instance::
>>> d = datetime.datetime.now()
>>> d
@@ -1718,11 +1718,11 @@
>>>
Instances can be compared, hashed, and converted to strings (the result is the
-same as that of :meth:`isoformat`). :class:`date` and :class:`datetime`
+same as that of :meth:`isoformat`). :class:`date` and :class:`~datetime.datetime`
instances can be subtracted from each other, and added to :class:`timedelta`
instances. The largest missing feature is that there's no standard library
support for parsing strings and getting back a :class:`date` or
-:class:`datetime`.
+:class:`~datetime.datetime`.
For more information, refer to the module's reference documentation.
(Contributed by Tim Peters.)
diff --git a/Doc/whatsnew/2.4.rst b/Doc/whatsnew/2.4.rst
--- a/Doc/whatsnew/2.4.rst
+++ b/Doc/whatsnew/2.4.rst
@@ -1523,7 +1523,7 @@
empty list instead of raising a :exc:`TypeError` exception if called with no
arguments.
-* You can no longer compare the :class:`date` and :class:`datetime` instances
+* You can no longer compare the :class:`date` and :class:`~datetime.datetime` instances
provided by the :mod:`datetime` module. Two instances of different classes
will now always be unequal, and relative comparisons (``<``, ``>``) will raise
a :exc:`TypeError`.
diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst
--- a/Doc/whatsnew/2.5.rst
+++ b/Doc/whatsnew/2.5.rst
@@ -1307,7 +1307,7 @@
(Contributed by Skip Montanaro and Andrew McNamara.)
-* The :class:`datetime` class in the :mod:`datetime` module now has a
+* The :class:`~datetime.datetime` class in the :mod:`datetime` module now has a
``strptime(string, format)`` method for parsing date strings, contributed
by Josh Spoerri. It uses the same format characters as :func:`time.strptime` and
:func:`time.strftime`::
@@ -1497,7 +1497,7 @@
* The :mod:`pyexpat` module now uses version 2.0 of the Expat parser.
(Contributed by Trent Mick.)
-* The :class:`Queue` class provided by the :mod:`Queue` module gained two new
+* The :class:`~queue.Queue` class provided by the :mod:`Queue` module gained two new
methods. :meth:`join` blocks until all items in the queue have been retrieved
and all processing work on the items have been completed. Worker threads call
the other new method, :meth:`task_done`, to signal that processing for an item
@@ -1649,7 +1649,7 @@
.. Patch #754022
-* The :mod:`xmlrpclib` module now supports returning :class:`datetime` objects
+* The :mod:`xmlrpclib` module now supports returning :class:`~datetime.datetime` objects
for the XML-RPC date type. Supply ``use_datetime=True`` to the :func:`loads`
function or the :class:`Unmarshaller` class to enable this feature. (Contributed
by Skip Montanaro.)
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -613,10 +613,10 @@
result = queue.get()
print 'Factorial', N, '=', result
-A :class:`Queue` is used to communicate the result of the factorial.
-The :class:`Queue` object is stored in a global variable.
+A :class:`~queue.Queue` is used to communicate the result of the factorial.
+The :class:`~queue.Queue` object is stored in a global variable.
The child process will use the value of the variable when the child
-was created; because it's a :class:`Queue`, parent and child can use
+was created; because it's a :class:`~queue.Queue`, parent and child can use
the object to communicate. (If the parent were to change the value of
the global variable, the child's value would be unaffected, and vice
versa.)
@@ -2131,7 +2131,7 @@
(Contributed by Christian Heimes and Mark Dickinson.)
-* :class:`mmap` objects now have a :meth:`rfind` method that searches for a
+* :class:`~mmap.mmap` objects now have a :meth:`rfind` method that searches for a
substring beginning at the end of the string and searching
backwards. The :meth:`find` method also gained an *end* parameter
giving an index at which to stop searching.
@@ -2630,7 +2630,7 @@
:class:`datetime.date` and :class:`datetime.time` to the
:class:`xmlrpclib.DateTime` type; the conversion semantics were
not necessarily correct for all applications. Code using
- :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
+ :mod:`xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
instances. (:issue:`1330538`) The code can also handle
dates before 1900 (contributed by Ralf Schmitt; :issue:`2014`)
and 64-bit integers represented by using ``<i8>`` in XML-RPC responses
@@ -3283,7 +3283,7 @@
:class:`datetime.date` and :class:`datetime.time` to the
:class:`xmlrpclib.DateTime` type; the conversion semantics were
not necessarily correct for all applications. Code using
- :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
+ :mod:`xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
instances. (:issue:`1330538`)
* (3.0-warning mode) The :class:`Exception` class now warns
--
Repository URL: https://hg.python.org/cpython
1
0
cpython (3.5): Issue #21818: Fixed references to classes that have names matching with module
by serhiy.storchaka 02 Dec '16
by serhiy.storchaka 02 Dec '16
02 Dec '16
https://hg.python.org/cpython/rev/d64e37b9204e
changeset: 105419:d64e37b9204e
branch: 3.5
parent: 105392:0bbd29405c9d
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Fri Dec 02 23:13:53 2016 +0200
summary:
Issue #21818: Fixed references to classes that have names matching with module
names.
files:
Doc/library/array.rst | 2 +-
Doc/library/datetime.rst | 6 +++---
Doc/library/mmap.rst | 8 ++++----
Doc/library/netrc.rst | 10 +++++-----
Doc/library/socket.rst | 2 +-
Doc/whatsnew/2.3.rst | 12 ++++++------
Doc/whatsnew/2.4.rst | 2 +-
Doc/whatsnew/2.5.rst | 6 +++---
Doc/whatsnew/2.6.rst | 12 ++++++------
9 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/Doc/library/array.rst b/Doc/library/array.rst
--- a/Doc/library/array.rst
+++ b/Doc/library/array.rst
@@ -254,7 +254,7 @@
empty, otherwise it is a string if the *typecode* is ``'u'``, otherwise it is a
list of numbers. The string is guaranteed to be able to be converted back to an
array with the same type and value using :func:`eval`, so long as the
-:func:`array` function has been imported using ``from array import array``.
+:class:`~array.array` class has been imported using ``from array import array``.
Examples::
array('l')
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -1296,8 +1296,8 @@
.. _datetime-time:
-:class:`time` Objects
----------------------
+:class:`.time` Objects
+----------------------
A time object represents a (local) time of day, independent of any particular
day, and subject to adjustment via a :class:`tzinfo` object.
@@ -1382,7 +1382,7 @@
``!=``. The latter cases return :const:`False` or :const:`True`, respectively.
.. versionchanged:: 3.3
- Equality comparisons between naive and aware :class:`time` instances
+ Equality comparisons between naive and aware :class:`~datetime.time` instances
don't raise :exc:`TypeError`.
* hash, use as dict key
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -14,7 +14,7 @@
slice: ``obj[i1:i2] = b'...'``. You can also read and write data starting at
the current file position, and :meth:`seek` through the file to different positions.
-A memory-mapped file is created by the :class:`mmap` constructor, which is
+A memory-mapped file is created by the :class:`~mmap.mmap` constructor, which is
different on Unix and on Windows. In either case you must provide a file
descriptor for a file opened for update. If you wish to map an existing Python
file object, use its :meth:`fileno` method to obtain the correct value for the
@@ -70,7 +70,7 @@
**(Unix version)** Maps *length* bytes from the file specified by the file
descriptor *fileno*, and returns a mmap object. If *length* is ``0``, the
maximum length of the map will be the current size of the file when
- :class:`mmap` is called.
+ :class:`~mmap.mmap` is called.
*flags* specifies the nature of the mapping. :const:`MAP_PRIVATE` creates a
private copy-on-write mapping, so changes to the contents of the mmap
@@ -97,7 +97,7 @@
by the descriptor *fileno* is internally automatically synchronized
with physical backing store on Mac OS X and OpenVMS.
- This example shows a simple way of using :class:`mmap`::
+ This example shows a simple way of using :class:`~mmap.mmap`::
import mmap
@@ -122,7 +122,7 @@
mm.close()
- :class:`mmap` can also be used as a context manager in a :keyword:`with`
+ :class:`~mmap.mmap` can also be used as a context manager in a :keyword:`with`
statement.::
import mmap
diff --git a/Doc/library/netrc.rst b/Doc/library/netrc.rst
--- a/Doc/library/netrc.rst
+++ b/Doc/library/netrc.rst
@@ -12,13 +12,13 @@
--------------
-The :class:`netrc` class parses and encapsulates the netrc file format used by
+The :class:`~netrc.netrc` class parses and encapsulates the netrc file format used by
the Unix :program:`ftp` program and other FTP clients.
.. class:: netrc([file])
- A :class:`netrc` instance or subclass instance encapsulates data from a netrc
+ A :class:`~netrc.netrc` instance or subclass instance encapsulates data from a netrc
file. The initialization argument, if present, specifies the file to parse. If
no argument is given, the file :file:`.netrc` in the user's home directory will
be read. Parse errors will raise :exc:`NetrcParseError` with diagnostic
@@ -35,7 +35,7 @@
.. exception:: NetrcParseError
- Exception raised by the :class:`netrc` class when syntactical errors are
+ Exception raised by the :class:`~netrc.netrc` class when syntactical errors are
encountered in source text. Instances of this exception provide three
interesting attributes: :attr:`msg` is a textual explanation of the error,
:attr:`filename` is the name of the source file, and :attr:`lineno` gives the
@@ -47,7 +47,7 @@
netrc Objects
-------------
-A :class:`netrc` instance has the following methods:
+A :class:`~netrc.netrc` instance has the following methods:
.. method:: netrc.authenticators(host)
@@ -63,7 +63,7 @@
Dump the class data as a string in the format of a netrc file. (This discards
comments and may reorder the entries.)
-Instances of :class:`netrc` have public instance variables:
+Instances of :class:`~netrc.netrc` have public instance variables:
.. attribute:: netrc.hosts
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -1367,7 +1367,7 @@
:meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument instead.
Socket objects also have these (read-only) attributes that correspond to the
-values given to the :class:`socket` constructor.
+values given to the :class:`~socket.socket` constructor.
.. attribute:: socket.family
diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst
--- a/Doc/whatsnew/2.3.rst
+++ b/Doc/whatsnew/2.3.rst
@@ -1683,13 +1683,13 @@
fancy features, and just stick to the basics of representing time.
The three primary types are: :class:`date`, representing a day, month, and year;
-:class:`time`, consisting of hour, minute, and second; and :class:`datetime`,
-which contains all the attributes of both :class:`date` and :class:`time`.
+:class:`~datetime.time`, consisting of hour, minute, and second; and :class:`~datetime.datetime`,
+which contains all the attributes of both :class:`date` and :class:`~datetime.time`.
There's also a :class:`timedelta` class representing differences between two
points in time, and time zone logic is implemented by classes inheriting from
the abstract :class:`tzinfo` class.
-You can create instances of :class:`date` and :class:`time` by either supplying
+You can create instances of :class:`date` and :class:`~datetime.time` by either supplying
keyword arguments to the appropriate constructor, e.g.
``datetime.date(year=1972, month=10, day=15)``, or by using one of a number of
class methods. For example, the :meth:`date.today` class method returns the
@@ -1708,7 +1708,7 @@
'2002 30 Dec'
The :meth:`replace` method allows modifying one or more fields of a
-:class:`date` or :class:`datetime` instance, returning a new instance::
+:class:`date` or :class:`~datetime.datetime` instance, returning a new instance::
>>> d = datetime.datetime.now()
>>> d
@@ -1718,11 +1718,11 @@
>>>
Instances can be compared, hashed, and converted to strings (the result is the
-same as that of :meth:`isoformat`). :class:`date` and :class:`datetime`
+same as that of :meth:`isoformat`). :class:`date` and :class:`~datetime.datetime`
instances can be subtracted from each other, and added to :class:`timedelta`
instances. The largest missing feature is that there's no standard library
support for parsing strings and getting back a :class:`date` or
-:class:`datetime`.
+:class:`~datetime.datetime`.
For more information, refer to the module's reference documentation.
(Contributed by Tim Peters.)
diff --git a/Doc/whatsnew/2.4.rst b/Doc/whatsnew/2.4.rst
--- a/Doc/whatsnew/2.4.rst
+++ b/Doc/whatsnew/2.4.rst
@@ -1523,7 +1523,7 @@
empty list instead of raising a :exc:`TypeError` exception if called with no
arguments.
-* You can no longer compare the :class:`date` and :class:`datetime` instances
+* You can no longer compare the :class:`date` and :class:`~datetime.datetime` instances
provided by the :mod:`datetime` module. Two instances of different classes
will now always be unequal, and relative comparisons (``<``, ``>``) will raise
a :exc:`TypeError`.
diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst
--- a/Doc/whatsnew/2.5.rst
+++ b/Doc/whatsnew/2.5.rst
@@ -1307,7 +1307,7 @@
(Contributed by Skip Montanaro and Andrew McNamara.)
-* The :class:`datetime` class in the :mod:`datetime` module now has a
+* The :class:`~datetime.datetime` class in the :mod:`datetime` module now has a
``strptime(string, format)`` method for parsing date strings, contributed
by Josh Spoerri. It uses the same format characters as :func:`time.strptime` and
:func:`time.strftime`::
@@ -1497,7 +1497,7 @@
* The :mod:`pyexpat` module now uses version 2.0 of the Expat parser.
(Contributed by Trent Mick.)
-* The :class:`Queue` class provided by the :mod:`Queue` module gained two new
+* The :class:`~queue.Queue` class provided by the :mod:`Queue` module gained two new
methods. :meth:`join` blocks until all items in the queue have been retrieved
and all processing work on the items have been completed. Worker threads call
the other new method, :meth:`task_done`, to signal that processing for an item
@@ -1649,7 +1649,7 @@
.. Patch #754022
-* The :mod:`xmlrpclib` module now supports returning :class:`datetime` objects
+* The :mod:`xmlrpclib` module now supports returning :class:`~datetime.datetime` objects
for the XML-RPC date type. Supply ``use_datetime=True`` to the :func:`loads`
function or the :class:`Unmarshaller` class to enable this feature. (Contributed
by Skip Montanaro.)
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -613,10 +613,10 @@
result = queue.get()
print 'Factorial', N, '=', result
-A :class:`Queue` is used to communicate the result of the factorial.
-The :class:`Queue` object is stored in a global variable.
+A :class:`~queue.Queue` is used to communicate the result of the factorial.
+The :class:`~queue.Queue` object is stored in a global variable.
The child process will use the value of the variable when the child
-was created; because it's a :class:`Queue`, parent and child can use
+was created; because it's a :class:`~queue.Queue`, parent and child can use
the object to communicate. (If the parent were to change the value of
the global variable, the child's value would be unaffected, and vice
versa.)
@@ -2131,7 +2131,7 @@
(Contributed by Christian Heimes and Mark Dickinson.)
-* :class:`mmap` objects now have a :meth:`rfind` method that searches for a
+* :class:`~mmap.mmap` objects now have a :meth:`rfind` method that searches for a
substring beginning at the end of the string and searching
backwards. The :meth:`find` method also gained an *end* parameter
giving an index at which to stop searching.
@@ -2630,7 +2630,7 @@
:class:`datetime.date` and :class:`datetime.time` to the
:class:`xmlrpclib.DateTime` type; the conversion semantics were
not necessarily correct for all applications. Code using
- :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
+ :mod:`xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
instances. (:issue:`1330538`) The code can also handle
dates before 1900 (contributed by Ralf Schmitt; :issue:`2014`)
and 64-bit integers represented by using ``<i8>`` in XML-RPC responses
@@ -3283,7 +3283,7 @@
:class:`datetime.date` and :class:`datetime.time` to the
:class:`xmlrpclib.DateTime` type; the conversion semantics were
not necessarily correct for all applications. Code using
- :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
+ :mod:`xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
instances. (:issue:`1330538`)
* (3.0-warning mode) The :class:`Exception` class now warns
--
Repository URL: https://hg.python.org/cpython
1
0
cpython (merge 3.5 -> 3.6): Issue #21818: Fixed references to classes that have names matching with module
by serhiy.storchaka 02 Dec '16
by serhiy.storchaka 02 Dec '16
02 Dec '16
https://hg.python.org/cpython/rev/62c9a89a2103
changeset: 105420:62c9a89a2103
branch: 3.6
parent: 105415:14c2d93ffcb3
parent: 105419:d64e37b9204e
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Fri Dec 02 23:15:22 2016 +0200
summary:
Issue #21818: Fixed references to classes that have names matching with module
names.
files:
Doc/library/array.rst | 2 +-
Doc/library/datetime.rst | 6 +++---
Doc/library/mmap.rst | 8 ++++----
Doc/library/netrc.rst | 10 +++++-----
Doc/library/socket.rst | 2 +-
Doc/whatsnew/2.3.rst | 12 ++++++------
Doc/whatsnew/2.4.rst | 2 +-
Doc/whatsnew/2.5.rst | 6 +++---
Doc/whatsnew/2.6.rst | 12 ++++++------
9 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/Doc/library/array.rst b/Doc/library/array.rst
--- a/Doc/library/array.rst
+++ b/Doc/library/array.rst
@@ -254,7 +254,7 @@
empty, otherwise it is a string if the *typecode* is ``'u'``, otherwise it is a
list of numbers. The string is guaranteed to be able to be converted back to an
array with the same type and value using :func:`eval`, so long as the
-:func:`array` function has been imported using ``from array import array``.
+:class:`~array.array` class has been imported using ``from array import array``.
Examples::
array('l')
diff --git a/Doc/library/datetime.rst b/Doc/library/datetime.rst
--- a/Doc/library/datetime.rst
+++ b/Doc/library/datetime.rst
@@ -1368,8 +1368,8 @@
.. _datetime-time:
-:class:`time` Objects
----------------------
+:class:`.time` Objects
+----------------------
A time object represents a (local) time of day, independent of any particular
day, and subject to adjustment via a :class:`tzinfo` object.
@@ -1466,7 +1466,7 @@
``!=``. The latter cases return :const:`False` or :const:`True`, respectively.
.. versionchanged:: 3.3
- Equality comparisons between naive and aware :class:`time` instances
+ Equality comparisons between naive and aware :class:`~datetime.time` instances
don't raise :exc:`TypeError`.
* hash, use as dict key
diff --git a/Doc/library/mmap.rst b/Doc/library/mmap.rst
--- a/Doc/library/mmap.rst
+++ b/Doc/library/mmap.rst
@@ -14,7 +14,7 @@
slice: ``obj[i1:i2] = b'...'``. You can also read and write data starting at
the current file position, and :meth:`seek` through the file to different positions.
-A memory-mapped file is created by the :class:`mmap` constructor, which is
+A memory-mapped file is created by the :class:`~mmap.mmap` constructor, which is
different on Unix and on Windows. In either case you must provide a file
descriptor for a file opened for update. If you wish to map an existing Python
file object, use its :meth:`fileno` method to obtain the correct value for the
@@ -70,7 +70,7 @@
**(Unix version)** Maps *length* bytes from the file specified by the file
descriptor *fileno*, and returns a mmap object. If *length* is ``0``, the
maximum length of the map will be the current size of the file when
- :class:`mmap` is called.
+ :class:`~mmap.mmap` is called.
*flags* specifies the nature of the mapping. :const:`MAP_PRIVATE` creates a
private copy-on-write mapping, so changes to the contents of the mmap
@@ -97,7 +97,7 @@
by the descriptor *fileno* is internally automatically synchronized
with physical backing store on Mac OS X and OpenVMS.
- This example shows a simple way of using :class:`mmap`::
+ This example shows a simple way of using :class:`~mmap.mmap`::
import mmap
@@ -122,7 +122,7 @@
mm.close()
- :class:`mmap` can also be used as a context manager in a :keyword:`with`
+ :class:`~mmap.mmap` can also be used as a context manager in a :keyword:`with`
statement.::
import mmap
diff --git a/Doc/library/netrc.rst b/Doc/library/netrc.rst
--- a/Doc/library/netrc.rst
+++ b/Doc/library/netrc.rst
@@ -12,13 +12,13 @@
--------------
-The :class:`netrc` class parses and encapsulates the netrc file format used by
+The :class:`~netrc.netrc` class parses and encapsulates the netrc file format used by
the Unix :program:`ftp` program and other FTP clients.
.. class:: netrc([file])
- A :class:`netrc` instance or subclass instance encapsulates data from a netrc
+ A :class:`~netrc.netrc` instance or subclass instance encapsulates data from a netrc
file. The initialization argument, if present, specifies the file to parse. If
no argument is given, the file :file:`.netrc` in the user's home directory will
be read. Parse errors will raise :exc:`NetrcParseError` with diagnostic
@@ -35,7 +35,7 @@
.. exception:: NetrcParseError
- Exception raised by the :class:`netrc` class when syntactical errors are
+ Exception raised by the :class:`~netrc.netrc` class when syntactical errors are
encountered in source text. Instances of this exception provide three
interesting attributes: :attr:`msg` is a textual explanation of the error,
:attr:`filename` is the name of the source file, and :attr:`lineno` gives the
@@ -47,7 +47,7 @@
netrc Objects
-------------
-A :class:`netrc` instance has the following methods:
+A :class:`~netrc.netrc` instance has the following methods:
.. method:: netrc.authenticators(host)
@@ -63,7 +63,7 @@
Dump the class data as a string in the format of a netrc file. (This discards
comments and may reorder the entries.)
-Instances of :class:`netrc` have public instance variables:
+Instances of :class:`~netrc.netrc` have public instance variables:
.. attribute:: netrc.hosts
diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst
--- a/Doc/library/socket.rst
+++ b/Doc/library/socket.rst
@@ -1429,7 +1429,7 @@
:meth:`~socket.recv` and :meth:`~socket.send` without *flags* argument instead.
Socket objects also have these (read-only) attributes that correspond to the
-values given to the :class:`socket` constructor.
+values given to the :class:`~socket.socket` constructor.
.. attribute:: socket.family
diff --git a/Doc/whatsnew/2.3.rst b/Doc/whatsnew/2.3.rst
--- a/Doc/whatsnew/2.3.rst
+++ b/Doc/whatsnew/2.3.rst
@@ -1683,13 +1683,13 @@
fancy features, and just stick to the basics of representing time.
The three primary types are: :class:`date`, representing a day, month, and year;
-:class:`time`, consisting of hour, minute, and second; and :class:`datetime`,
-which contains all the attributes of both :class:`date` and :class:`time`.
+:class:`~datetime.time`, consisting of hour, minute, and second; and :class:`~datetime.datetime`,
+which contains all the attributes of both :class:`date` and :class:`~datetime.time`.
There's also a :class:`timedelta` class representing differences between two
points in time, and time zone logic is implemented by classes inheriting from
the abstract :class:`tzinfo` class.
-You can create instances of :class:`date` and :class:`time` by either supplying
+You can create instances of :class:`date` and :class:`~datetime.time` by either supplying
keyword arguments to the appropriate constructor, e.g.
``datetime.date(year=1972, month=10, day=15)``, or by using one of a number of
class methods. For example, the :meth:`date.today` class method returns the
@@ -1708,7 +1708,7 @@
'2002 30 Dec'
The :meth:`replace` method allows modifying one or more fields of a
-:class:`date` or :class:`datetime` instance, returning a new instance::
+:class:`date` or :class:`~datetime.datetime` instance, returning a new instance::
>>> d = datetime.datetime.now()
>>> d
@@ -1718,11 +1718,11 @@
>>>
Instances can be compared, hashed, and converted to strings (the result is the
-same as that of :meth:`isoformat`). :class:`date` and :class:`datetime`
+same as that of :meth:`isoformat`). :class:`date` and :class:`~datetime.datetime`
instances can be subtracted from each other, and added to :class:`timedelta`
instances. The largest missing feature is that there's no standard library
support for parsing strings and getting back a :class:`date` or
-:class:`datetime`.
+:class:`~datetime.datetime`.
For more information, refer to the module's reference documentation.
(Contributed by Tim Peters.)
diff --git a/Doc/whatsnew/2.4.rst b/Doc/whatsnew/2.4.rst
--- a/Doc/whatsnew/2.4.rst
+++ b/Doc/whatsnew/2.4.rst
@@ -1523,7 +1523,7 @@
empty list instead of raising a :exc:`TypeError` exception if called with no
arguments.
-* You can no longer compare the :class:`date` and :class:`datetime` instances
+* You can no longer compare the :class:`date` and :class:`~datetime.datetime` instances
provided by the :mod:`datetime` module. Two instances of different classes
will now always be unequal, and relative comparisons (``<``, ``>``) will raise
a :exc:`TypeError`.
diff --git a/Doc/whatsnew/2.5.rst b/Doc/whatsnew/2.5.rst
--- a/Doc/whatsnew/2.5.rst
+++ b/Doc/whatsnew/2.5.rst
@@ -1307,7 +1307,7 @@
(Contributed by Skip Montanaro and Andrew McNamara.)
-* The :class:`datetime` class in the :mod:`datetime` module now has a
+* The :class:`~datetime.datetime` class in the :mod:`datetime` module now has a
``strptime(string, format)`` method for parsing date strings, contributed
by Josh Spoerri. It uses the same format characters as :func:`time.strptime` and
:func:`time.strftime`::
@@ -1497,7 +1497,7 @@
* The :mod:`pyexpat` module now uses version 2.0 of the Expat parser.
(Contributed by Trent Mick.)
-* The :class:`Queue` class provided by the :mod:`Queue` module gained two new
+* The :class:`~queue.Queue` class provided by the :mod:`Queue` module gained two new
methods. :meth:`join` blocks until all items in the queue have been retrieved
and all processing work on the items have been completed. Worker threads call
the other new method, :meth:`task_done`, to signal that processing for an item
@@ -1649,7 +1649,7 @@
.. Patch #754022
-* The :mod:`xmlrpclib` module now supports returning :class:`datetime` objects
+* The :mod:`xmlrpclib` module now supports returning :class:`~datetime.datetime` objects
for the XML-RPC date type. Supply ``use_datetime=True`` to the :func:`loads`
function or the :class:`Unmarshaller` class to enable this feature. (Contributed
by Skip Montanaro.)
diff --git a/Doc/whatsnew/2.6.rst b/Doc/whatsnew/2.6.rst
--- a/Doc/whatsnew/2.6.rst
+++ b/Doc/whatsnew/2.6.rst
@@ -613,10 +613,10 @@
result = queue.get()
print 'Factorial', N, '=', result
-A :class:`Queue` is used to communicate the result of the factorial.
-The :class:`Queue` object is stored in a global variable.
+A :class:`~queue.Queue` is used to communicate the result of the factorial.
+The :class:`~queue.Queue` object is stored in a global variable.
The child process will use the value of the variable when the child
-was created; because it's a :class:`Queue`, parent and child can use
+was created; because it's a :class:`~queue.Queue`, parent and child can use
the object to communicate. (If the parent were to change the value of
the global variable, the child's value would be unaffected, and vice
versa.)
@@ -2131,7 +2131,7 @@
(Contributed by Christian Heimes and Mark Dickinson.)
-* :class:`mmap` objects now have a :meth:`rfind` method that searches for a
+* :class:`~mmap.mmap` objects now have a :meth:`rfind` method that searches for a
substring beginning at the end of the string and searching
backwards. The :meth:`find` method also gained an *end* parameter
giving an index at which to stop searching.
@@ -2630,7 +2630,7 @@
:class:`datetime.date` and :class:`datetime.time` to the
:class:`xmlrpclib.DateTime` type; the conversion semantics were
not necessarily correct for all applications. Code using
- :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
+ :mod:`xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
instances. (:issue:`1330538`) The code can also handle
dates before 1900 (contributed by Ralf Schmitt; :issue:`2014`)
and 64-bit integers represented by using ``<i8>`` in XML-RPC responses
@@ -3283,7 +3283,7 @@
:class:`datetime.date` and :class:`datetime.time` to the
:class:`xmlrpclib.DateTime` type; the conversion semantics were
not necessarily correct for all applications. Code using
- :mod:`xmlrpclib` should convert :class:`date` and :class:`time`
+ :mod:`xmlrpclib` should convert :class:`date` and :class:`~datetime.time`
instances. (:issue:`1330538`)
* (3.0-warning mode) The :class:`Exception` class now warns
--
Repository URL: https://hg.python.org/cpython
1
0
https://hg.python.org/cpython/rev/8e1f7bc92392
changeset: 105416:8e1f7bc92392
parent: 105411:96245d4af0ca
parent: 105405:c9f68150cf90
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Fri Dec 02 21:33:05 2016 +0200
summary:
Null merge
files:
--
Repository URL: https://hg.python.org/cpython
1
0
https://hg.python.org/cpython/rev/dd4c420b8e66
changeset: 105417:dd4c420b8e66
parent: 105416:8e1f7bc92392
parent: 105415:14c2d93ffcb3
user: Serhiy Storchaka <storchaka(a)gmail.com>
date: Fri Dec 02 21:38:46 2016 +0200
summary:
Merge from 3.6.
files:
Doc/library/inspect.rst | 54 +++++++++++++++++++---------
Doc/whatsnew/3.6.rst | 7 +++
Lib/inspect.py | 46 ++++++++++++++----------
Misc/NEWS | 5 ++
4 files changed, 76 insertions(+), 36 deletions(-)
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -815,45 +815,65 @@
.. function:: getargspec(func)
- Get the names and default values of a Python function's arguments. A
+ Get the names and default values of a Python function's parameters. A
:term:`named tuple` ``ArgSpec(args, varargs, keywords, defaults)`` is
- returned. *args* is a list of the argument names. *varargs* and *keywords*
- are the names of the ``*`` and ``**`` arguments or ``None``. *defaults* is a
+ returned. *args* is a list of the parameter names. *varargs* and *keywords*
+ are the names of the ``*`` and ``**`` parameters or ``None``. *defaults* is a
tuple of default argument values or ``None`` if there are no default
arguments; if this tuple has *n* elements, they correspond to the last
*n* elements listed in *args*.
.. deprecated:: 3.0
- Use :func:`signature` and
+ Use :func:`getfullargspec` for an updated API that is usually a drop-in
+ replacement, but also correctly handles function annotations and
+ keyword-only parameters.
+
+ Alternatively, use :func:`signature` and
:ref:`Signature Object <inspect-signature-object>`, which provide a
- better introspecting API for callables.
+ more structured introspection API for callables.
.. function:: getfullargspec(func)
- Get the names and default values of a Python function's arguments. A
+ Get the names and default values of a Python function's parameters. A
:term:`named tuple` is returned:
``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults,
annotations)``
- *args* is a list of the argument names. *varargs* and *varkw* are the names
- of the ``*`` and ``**`` arguments or ``None``. *defaults* is an *n*-tuple
- of the default values of the last *n* arguments, or ``None`` if there are no
- default arguments. *kwonlyargs* is a list of
- keyword-only argument names. *kwonlydefaults* is a dictionary mapping names
- from kwonlyargs to defaults. *annotations* is a dictionary mapping argument
- names to annotations.
+ *args* is a list of the positional parameter names.
+ *varargs* is the name of the ``*`` parameter or ``None`` if arbitrary
+ positional arguments are not accepted.
+ *varkw* is the name of the ``**`` parameter or ``None`` if arbitrary
+ keyword arguments are not accepted.
+ *defaults* is an *n*-tuple of default argument values corresponding to the
+ last *n* positional parameters, or ``None`` if there are no such defaults
+ defined.
+ *kwonlyargs* is a list of keyword-only parameter names.
+ *kwonlydefaults* is a dictionary mapping parameter names from *kwonlyargs*
+ to the default values used if no argument is supplied.
+ *annotations* is a dictionary mapping parameter names to annotations.
+ The special key ``"return"`` is used to report the function return value
+ annotation (if any).
+
+ Note that :func:`signature` and
+ :ref:`Signature Object <inspect-signature-object>` provide the recommended
+ API for callable introspection, and support additional behaviours (like
+ positional-only arguments) that are sometimes encountered in extension module
+ APIs. This function is retained primarily for use in code that needs to
+ maintain compatibility with the Python 2 ``inspect`` module API.
.. versionchanged:: 3.4
This function is now based on :func:`signature`, but still ignores
``__wrapped__`` attributes and includes the already bound first
parameter in the signature output for bound methods.
- .. deprecated:: 3.5
- Use :func:`signature` and
- :ref:`Signature Object <inspect-signature-object>`, which provide a
- better introspecting API for callables.
+ .. versionchanged:: 3.6
+ This method was previously documented as deprecated in favour of
+ :func:`signature` in Python 3.5, but that decision has been reversed
+ in order to restore a clearly supported standard interface for
+ single-source Python 2/3 code migrating away from the legacy
+ :func:`getargspec` API.
.. function:: getargvalues(frame)
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -1155,6 +1155,13 @@
generator expression scopes as if they were positional-only parameters called
``implicit0``. (Contributed by Jelle Zijlstra in :issue:`19611`.)
+To reduce code churn when upgrading from Python 2.7 and the legacy
+:func:`inspect.getargspec` API, the previously documented deprecation of
+:func:`inspect.getfullargspec` has been reversed. While this function is
+convenient for single/source Python 2/3 code bases, the richer
+:func:`inspect.signature` interface remains the recommended approach for new
+code. (Contributed by Nick Coghlan in :issue:`27172`)
+
json
----
diff --git a/Lib/inspect.py b/Lib/inspect.py
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -1019,24 +1019,30 @@
ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')
def getargspec(func):
- """Get the names and default values of a function's arguments.
+ """Get the names and default values of a function's parameters.
A tuple of four things is returned: (args, varargs, keywords, defaults).
'args' is a list of the argument names, including keyword-only argument names.
- 'varargs' and 'keywords' are the names of the * and ** arguments or None.
- 'defaults' is an n-tuple of the default values of the last n arguments.
-
- Use the getfullargspec() API for Python 3 code, as annotations
- and keyword arguments are supported. getargspec() will raise ValueError
- if the func has either annotations or keyword arguments.
+ 'varargs' and 'keywords' are the names of the * and ** parameters or None.
+ 'defaults' is an n-tuple of the default values of the last n parameters.
+
+ This function is deprecated, as it does not support annotations or
+ keyword-only parameters and will raise ValueError if either is present
+ on the supplied callable.
+
+ For a more structured introspection API, use inspect.signature() instead.
+
+ Alternatively, use getfullargspec() for an API with a similar namedtuple
+ based interface, but full support for annotations and keyword-only
+ parameters.
"""
warnings.warn("inspect.getargspec() is deprecated, "
- "use inspect.signature() instead", DeprecationWarning,
- stacklevel=2)
+ "use inspect.signature() or inspect.getfullargspec()",
+ DeprecationWarning, stacklevel=2)
args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \
getfullargspec(func)
if kwonlyargs or ann:
- raise ValueError("Function has keyword-only arguments or annotations"
+ raise ValueError("Function has keyword-only parameters or annotations"
", use getfullargspec() API which can support them")
return ArgSpec(args, varargs, varkw, defaults)
@@ -1044,18 +1050,20 @@
'args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations')
def getfullargspec(func):
- """Get the names and default values of a callable object's arguments.
+ """Get the names and default values of a callable object's parameters.
A tuple of seven things is returned:
- (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults annotations).
- 'args' is a list of the argument names.
- 'varargs' and 'varkw' are the names of the * and ** arguments or None.
- 'defaults' is an n-tuple of the default values of the last n arguments.
- 'kwonlyargs' is a list of keyword-only argument names.
+ (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations).
+ 'args' is a list of the parameter names.
+ 'varargs' and 'varkw' are the names of the * and ** parameters or None.
+ 'defaults' is an n-tuple of the default values of the last n parameters.
+ 'kwonlyargs' is a list of keyword-only parameter names.
'kwonlydefaults' is a dictionary mapping names from kwonlyargs to defaults.
- 'annotations' is a dictionary mapping argument names to annotations.
-
- This function is deprecated, use inspect.signature() instead.
+ 'annotations' is a dictionary mapping parameter names to annotations.
+
+ Notable differences from inspect.signature():
+ - the "self" parameter is always reported, even for bound methods
+ - wrapper chains defined by __wrapped__ *not* unwrapped automatically
"""
try:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -160,6 +160,11 @@
Library
-------
+- Issue #27172: To assist with upgrades from 2.7, the previously documented
+ deprecation of ``inspect.getfullargspec()`` has been reversed. This decision
+ may be revisited again after the Python 2.7 branch is no longer officially
+ supported.
+
- Issue #28740: Add sys.getandroidapilevel(): return the build time API version
of Android as an integer. Function only available on Android.
--
Repository URL: https://hg.python.org/cpython
1
0
02 Dec '16
https://hg.python.org/cpython/rev/14c2d93ffcb3
changeset: 105415:14c2d93ffcb3
branch: 3.6
parent: 105405:c9f68150cf90
user: Nick Coghlan <ncoghlan(a)gmail.com>
date: Fri Dec 02 20:29:57 2016 +1000
summary:
Issue #27172: Undeprecate inspect.getfullargspec()
This is still useful for single source Python 2/3 code
migrating away from inspect.getargspec(), but that wasn't
clear with the documented deprecation in place.
files:
Doc/library/inspect.rst | 54 +++++++++++++++++++---------
Doc/whatsnew/3.6.rst | 7 +++
Lib/inspect.py | 46 ++++++++++++++----------
Misc/NEWS | 5 ++
4 files changed, 76 insertions(+), 36 deletions(-)
diff --git a/Doc/library/inspect.rst b/Doc/library/inspect.rst
--- a/Doc/library/inspect.rst
+++ b/Doc/library/inspect.rst
@@ -815,45 +815,65 @@
.. function:: getargspec(func)
- Get the names and default values of a Python function's arguments. A
+ Get the names and default values of a Python function's parameters. A
:term:`named tuple` ``ArgSpec(args, varargs, keywords, defaults)`` is
- returned. *args* is a list of the argument names. *varargs* and *keywords*
- are the names of the ``*`` and ``**`` arguments or ``None``. *defaults* is a
+ returned. *args* is a list of the parameter names. *varargs* and *keywords*
+ are the names of the ``*`` and ``**`` parameters or ``None``. *defaults* is a
tuple of default argument values or ``None`` if there are no default
arguments; if this tuple has *n* elements, they correspond to the last
*n* elements listed in *args*.
.. deprecated:: 3.0
- Use :func:`signature` and
+ Use :func:`getfullargspec` for an updated API that is usually a drop-in
+ replacement, but also correctly handles function annotations and
+ keyword-only parameters.
+
+ Alternatively, use :func:`signature` and
:ref:`Signature Object <inspect-signature-object>`, which provide a
- better introspecting API for callables.
+ more structured introspection API for callables.
.. function:: getfullargspec(func)
- Get the names and default values of a Python function's arguments. A
+ Get the names and default values of a Python function's parameters. A
:term:`named tuple` is returned:
``FullArgSpec(args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults,
annotations)``
- *args* is a list of the argument names. *varargs* and *varkw* are the names
- of the ``*`` and ``**`` arguments or ``None``. *defaults* is an *n*-tuple
- of the default values of the last *n* arguments, or ``None`` if there are no
- default arguments. *kwonlyargs* is a list of
- keyword-only argument names. *kwonlydefaults* is a dictionary mapping names
- from kwonlyargs to defaults. *annotations* is a dictionary mapping argument
- names to annotations.
+ *args* is a list of the positional parameter names.
+ *varargs* is the name of the ``*`` parameter or ``None`` if arbitrary
+ positional arguments are not accepted.
+ *varkw* is the name of the ``**`` parameter or ``None`` if arbitrary
+ keyword arguments are not accepted.
+ *defaults* is an *n*-tuple of default argument values corresponding to the
+ last *n* positional parameters, or ``None`` if there are no such defaults
+ defined.
+ *kwonlyargs* is a list of keyword-only parameter names.
+ *kwonlydefaults* is a dictionary mapping parameter names from *kwonlyargs*
+ to the default values used if no argument is supplied.
+ *annotations* is a dictionary mapping parameter names to annotations.
+ The special key ``"return"`` is used to report the function return value
+ annotation (if any).
+
+ Note that :func:`signature` and
+ :ref:`Signature Object <inspect-signature-object>` provide the recommended
+ API for callable introspection, and support additional behaviours (like
+ positional-only arguments) that are sometimes encountered in extension module
+ APIs. This function is retained primarily for use in code that needs to
+ maintain compatibility with the Python 2 ``inspect`` module API.
.. versionchanged:: 3.4
This function is now based on :func:`signature`, but still ignores
``__wrapped__`` attributes and includes the already bound first
parameter in the signature output for bound methods.
- .. deprecated:: 3.5
- Use :func:`signature` and
- :ref:`Signature Object <inspect-signature-object>`, which provide a
- better introspecting API for callables.
+ .. versionchanged:: 3.6
+ This method was previously documented as deprecated in favour of
+ :func:`signature` in Python 3.5, but that decision has been reversed
+ in order to restore a clearly supported standard interface for
+ single-source Python 2/3 code migrating away from the legacy
+ :func:`getargspec` API.
.. function:: getargvalues(frame)
diff --git a/Doc/whatsnew/3.6.rst b/Doc/whatsnew/3.6.rst
--- a/Doc/whatsnew/3.6.rst
+++ b/Doc/whatsnew/3.6.rst
@@ -1155,6 +1155,13 @@
generator expression scopes as if they were positional-only parameters called
``implicit0``. (Contributed by Jelle Zijlstra in :issue:`19611`.)
+To reduce code churn when upgrading from Python 2.7 and the legacy
+:func:`inspect.getargspec` API, the previously documented deprecation of
+:func:`inspect.getfullargspec` has been reversed. While this function is
+convenient for single/source Python 2/3 code bases, the richer
+:func:`inspect.signature` interface remains the recommended approach for new
+code. (Contributed by Nick Coghlan in :issue:`27172`)
+
json
----
diff --git a/Lib/inspect.py b/Lib/inspect.py
--- a/Lib/inspect.py
+++ b/Lib/inspect.py
@@ -1019,24 +1019,30 @@
ArgSpec = namedtuple('ArgSpec', 'args varargs keywords defaults')
def getargspec(func):
- """Get the names and default values of a function's arguments.
+ """Get the names and default values of a function's parameters.
A tuple of four things is returned: (args, varargs, keywords, defaults).
'args' is a list of the argument names, including keyword-only argument names.
- 'varargs' and 'keywords' are the names of the * and ** arguments or None.
- 'defaults' is an n-tuple of the default values of the last n arguments.
-
- Use the getfullargspec() API for Python 3 code, as annotations
- and keyword arguments are supported. getargspec() will raise ValueError
- if the func has either annotations or keyword arguments.
+ 'varargs' and 'keywords' are the names of the * and ** parameters or None.
+ 'defaults' is an n-tuple of the default values of the last n parameters.
+
+ This function is deprecated, as it does not support annotations or
+ keyword-only parameters and will raise ValueError if either is present
+ on the supplied callable.
+
+ For a more structured introspection API, use inspect.signature() instead.
+
+ Alternatively, use getfullargspec() for an API with a similar namedtuple
+ based interface, but full support for annotations and keyword-only
+ parameters.
"""
warnings.warn("inspect.getargspec() is deprecated, "
- "use inspect.signature() instead", DeprecationWarning,
- stacklevel=2)
+ "use inspect.signature() or inspect.getfullargspec()",
+ DeprecationWarning, stacklevel=2)
args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = \
getfullargspec(func)
if kwonlyargs or ann:
- raise ValueError("Function has keyword-only arguments or annotations"
+ raise ValueError("Function has keyword-only parameters or annotations"
", use getfullargspec() API which can support them")
return ArgSpec(args, varargs, varkw, defaults)
@@ -1044,18 +1050,20 @@
'args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations')
def getfullargspec(func):
- """Get the names and default values of a callable object's arguments.
+ """Get the names and default values of a callable object's parameters.
A tuple of seven things is returned:
- (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults annotations).
- 'args' is a list of the argument names.
- 'varargs' and 'varkw' are the names of the * and ** arguments or None.
- 'defaults' is an n-tuple of the default values of the last n arguments.
- 'kwonlyargs' is a list of keyword-only argument names.
+ (args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, annotations).
+ 'args' is a list of the parameter names.
+ 'varargs' and 'varkw' are the names of the * and ** parameters or None.
+ 'defaults' is an n-tuple of the default values of the last n parameters.
+ 'kwonlyargs' is a list of keyword-only parameter names.
'kwonlydefaults' is a dictionary mapping names from kwonlyargs to defaults.
- 'annotations' is a dictionary mapping argument names to annotations.
-
- This function is deprecated, use inspect.signature() instead.
+ 'annotations' is a dictionary mapping parameter names to annotations.
+
+ Notable differences from inspect.signature():
+ - the "self" parameter is always reported, even for bound methods
+ - wrapper chains defined by __wrapped__ *not* unwrapped automatically
"""
try:
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -21,6 +21,11 @@
Library
-------
+- Issue #27172: To assist with upgrades from 2.7, the previously documented
+ deprecation of ``inspect.getfullargspec()`` has been reversed. This decision
+ may be revisited again after the Python 2.7 branch is no longer officially
+ supported.
+
- Issue #24142: Reading a corrupt config file left configparser in an
invalid state. Original patch by Florian Höch.
--
Repository URL: https://hg.python.org/cpython
1
0