[issue39545] await is not supported in f-string in 3.6

2020-02-04 Thread Rohit Sanjay


Rohit Sanjay  added the comment:

Hey, I'd like to work on this issue. Seems like an easy fix. Can you please 
help me out with where I will need to add the documentation for this?

--
nosy: +rohitsanjay

___
Python tracker 
<https://bugs.python.org/issue39545>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38335] simplify overlaps function in ipaddress.py

2019-10-05 Thread Sanjay


Sanjay  added the comment:

the version in the patch is less code a or b or c or d becomes a or d

the version in PR is using the subnet_of, supernet_of function because overlap 
means either a is subnet_of or supernet_of b. So was trying to consolidate the 
implementation of overlap from 2 to 1.

--

___
Python tracker 
<https://bugs.python.org/issue38335>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38335] simplify overlaps function in ipaddress.py

2019-10-02 Thread Sanjay


Change by Sanjay :


--
nosy: +serhiy.storchaka

___
Python tracker 
<https://bugs.python.org/issue38335>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38337] inspect: getmembers calls properties

2019-10-01 Thread Sanjay


Sanjay  added the comment:

the issue happens in 2.7 as well

--
nosy: +Sanjay
versions: +Python 2.7

___
Python tracker 
<https://bugs.python.org/issue38337>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38335] simplify overlaps function in ipaddress.py

2019-10-01 Thread Sanjay


Change by Sanjay :


--
pull_requests: +16110
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/16519

___
Python tracker 
<https://bugs.python.org/issue38335>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38335] simplify overlaps function in ipaddress.py

2019-10-01 Thread Sanjay


New submission from Sanjay :

the current implementation of overlaps function tests either network or 
broadcast address is in other but
we can skip checking broadcast address is in other because we anyway check if 
other.network_address in self 

without loss of generality if we assume self has smaller prefixlen than other 
then when self.broadcast_address in other then other.network_address *SHOULD* 
be in self but the reverse is not true

so my first patch was to make the function logic simply do
`self.network_address in other or other.network_address in self`

but the current PR does a different change. We have introduced two new 
functions subnet_of and supernet_of

for two networks A, B there are only three possibilities 
1. they don't overlap
2. A is subnet of B
3. B is subnet of A

so we can reuse the existing function and just do
`return self.subnet_of(other) or self.supernet_of(other)`
the only thing is while overlaps() function returns false when we try to 
compare with a network or with diff version the other throws exception so I 
added a typecheck in the beginning.

P.S the docstring is slightly convoluted for newcomers, based on the three 
possibilities it should say "Tell if self is supernet or subnet of other" 
because "partly contained" can also mean two ranges intersect which can never 
happen to network prefixes. I have not made that change but can make it.

There are also some other issues I want to address but I want to do one at a 
time.

--
components: Library (Lib)
files: skip_broadcast_in.patch
keywords: patch
messages: 353676
nosy: Sanjay
priority: normal
severity: normal
status: open
title: simplify overlaps function in ipaddress.py
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9
Added file: https://bugs.python.org/file48634/skip_broadcast_in.patch

___
Python tracker 
<https://bugs.python.org/issue38335>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34233] subprocess.check_output goes to infinte loop

2018-07-26 Thread sanjay patel


New submission from sanjay patel :

Below snipped goes to infinite loop when running through windows command prompt 
but works in python IDLE

import subprocess
subprocess.check_output('cmd.exe dir', stderr=subprocess.STDOUT)

save as:test.py
in windows cmd use command: python test.py
then it goes to infine loop but the same program works in Python IDLE.

--
components: Library (Lib)
messages: 322413
nosy: sanjay patel
priority: normal
severity: normal
status: open
title: subprocess.check_output goes to infinte loop
type: behavior
versions: Python 3.6

___
Python tracker 
<https://bugs.python.org/issue34233>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29931] ipaddress.ip_interface __lt__ check seems to be broken

2017-03-28 Thread Sanjay

New submission from Sanjay:

The less than check for ip_interface behavior seems weird. I am not sure if 
this is by design. We are just comparing the network address but when network 
address is equal we should compare the ip address.
The expectation is if a < b is False then b <= a must be True
>>> import ipaddress
>>> a = ipaddress.ip_interface("1.1.1.1/24")
>>> b = ipaddress.ip_interface("1.1.1.2/24")
>>> a < b
False
>>> b <= a
False
>>> a == b
False
>>> 
This happens with both v4 and v6
The tests were passing because in ComparisonTests we were testing with prefix 
length of 32 which means the whole ip address became the network address.
I have made a fix here:
https://github.com/s-sanjay/cpython/commit/14975f58539308b7af5a1519705fb8cd95ad7951
I can add more tests and send PR but before that I wanted to confirm the 
behavior.

--
components: Library (Lib)
messages: 290695
nosy: Sanjay, ncoghlan, pmoody, xiang.zhang
priority: normal
severity: normal
status: open
title: ipaddress.ip_interface __lt__ check seems to be broken
type: behavior
versions: Python 3.7

___
Python tracker 
<http://bugs.python.org/issue29931>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29913] ipadress compare_networks does not work according to documentation

2017-03-27 Thread Sanjay

Sanjay added the comment:

ok I will update the doc

--

___
Python tracker 
<http://bugs.python.org/issue29913>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29913] ipadress compare_networks does not work according to documentation

2017-03-27 Thread Sanjay

Sanjay added the comment:

yes but compare_networks is not used to implement equality check. __eq__ 
correctly returns False when we do 1.1.1.0/24 == 1.1.1.0/25.
If compare_networks works exactly like __eq__ then it seems a bit redundant.

--

___
Python tracker 
<http://bugs.python.org/issue29913>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29913] ipadress compare_networks does not work according to documentation

2017-03-27 Thread Sanjay

Changes by Sanjay :


--
pull_requests: +739

___
Python tracker 
<http://bugs.python.org/issue29913>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29913] ipadress compare_networks does not work according to documentation

2017-03-27 Thread Sanjay

New submission from Sanjay:

according to the docs compare_networks only checks the network address but the 
implementation is also taking the mask length into account. It returns '0' only 
if both the network address and the mask are equal but this can be done with 
just equality check ( ip1 == ip2 )

Example:
>>> ip1=ipaddress.ip_network("1.1.1.0/24")
>>> ip2=ipaddress.ip_network("1.1.1.0/25")
>>> ip1.compare_networks(ip2)
-1
>>> ip1 == ip2
False
>>> ip1.network_address
IPv4Address('1.1.1.0')
>>> ip2.network_address
IPv4Address('1.1.1.0')
>>> 

shouldn't we ignore the mask length ? I have tried it here:

https://github.com/s-sanjay/cpython/commit/942073c1ebd29891e047b5e784750c2b6f74494a

--
components: Library (Lib)
messages: 290566
nosy: Sanjay
priority: normal
severity: normal
status: open
title: ipadress compare_networks does not work according to documentation
type: behavior
versions: Python 3.7

___
Python tracker 
<http://bugs.python.org/issue29913>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com