Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
24b102e6
Kaydet (Commit)
24b102e6
authored
Haz 11, 2016
tarafından
Berker Peksag
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Sade Fark
Issue #21386: Merge from 3.5
üst
4da945f3
742192a4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
0 deletions
+13
-0
ipaddress.py
Lib/ipaddress.py
+7
-0
test_ipaddress.py
Lib/test/test_ipaddress.py
+3
-0
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/ipaddress.py
Dosyayı görüntüle @
24b102e6
...
@@ -1311,6 +1311,11 @@ class IPv4Address(_BaseV4, _BaseAddress):
...
@@ -1311,6 +1311,11 @@ class IPv4Address(_BaseV4, _BaseAddress):
"""
"""
return
any
(
self
in
net
for
net
in
self
.
_constants
.
_private_networks
)
return
any
(
self
in
net
for
net
in
self
.
_constants
.
_private_networks
)
@property
@functools.lru_cache
()
def
is_global
(
self
):
return
self
not
in
self
.
_constants
.
_public_network
and
not
self
.
is_private
@property
@property
def
is_multicast
(
self
):
def
is_multicast
(
self
):
"""Test if the address is reserved for multicast use.
"""Test if the address is reserved for multicast use.
...
@@ -1557,6 +1562,8 @@ class _IPv4Constants:
...
@@ -1557,6 +1562,8 @@ class _IPv4Constants:
_multicast_network
=
IPv4Network
(
'224.0.0.0/4'
)
_multicast_network
=
IPv4Network
(
'224.0.0.0/4'
)
_public_network
=
IPv4Network
(
'100.64.0.0/10'
)
_private_networks
=
[
_private_networks
=
[
IPv4Network
(
'0.0.0.0/8'
),
IPv4Network
(
'0.0.0.0/8'
),
IPv4Network
(
'10.0.0.0/8'
),
IPv4Network
(
'10.0.0.0/8'
),
...
...
Lib/test/test_ipaddress.py
Dosyayı görüntüle @
24b102e6
...
@@ -1626,6 +1626,9 @@ class IpaddrUnitTest(unittest.TestCase):
...
@@ -1626,6 +1626,9 @@ class IpaddrUnitTest(unittest.TestCase):
self
.
assertEqual
(
False
,
self
.
assertEqual
(
False
,
ipaddress
.
ip_address
(
'169.255.100.200'
)
.
is_link_local
)
ipaddress
.
ip_address
(
'169.255.100.200'
)
.
is_link_local
)
self
.
assertTrue
(
ipaddress
.
ip_address
(
'192.0.7.1'
)
.
is_global
)
self
.
assertFalse
(
ipaddress
.
ip_address
(
'203.0.113.1'
)
.
is_global
)
self
.
assertEqual
(
True
,
self
.
assertEqual
(
True
,
ipaddress
.
ip_address
(
'127.100.200.254'
)
.
is_loopback
)
ipaddress
.
ip_address
(
'127.100.200.254'
)
.
is_loopback
)
self
.
assertEqual
(
True
,
ipaddress
.
ip_address
(
'127.42.0.0'
)
.
is_loopback
)
self
.
assertEqual
(
True
,
ipaddress
.
ip_address
(
'127.42.0.0'
)
.
is_loopback
)
...
...
Misc/NEWS
Dosyayı görüntüle @
24b102e6
...
@@ -38,6 +38,9 @@ Core and Builtins
...
@@ -38,6 +38,9 @@ Core and Builtins
Library
Library
-------
-------
- Issue #21386: Implement missing IPv4Address.is_global property. It was
documented since 07a5610bae9d. Initial patch by Roger Luethi.
- Issue #27029: Removed deprecated support of universal newlines mode from
- Issue #27029: Removed deprecated support of universal newlines mode from
ZipFile.open().
ZipFile.open().
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment