bpo-38335 simplify the overlap function for IpNetwork#16519
bpo-38335 simplify the overlap function for IpNetwork#16519s-sanjay wants to merge 2 commits intopython:mainfrom
Conversation
|
no news entry needed as there is no behavior change |
…global for network
remilapeyre
left a comment
There was a problem hiding this comment.
Hi @s-sanjay, you should not move the method around in the file while changing them as it make reviewing the changes harder. Can you please move them back where they were?
| self.hosts = self.__iter__ | ||
|
|
||
| @property | ||
| @functools.lru_cache() |
There was a problem hiding this comment.
Why did you removed this decorator?
There was a problem hiding this comment.
because self.network_address.is_global which in turn calls is_private already has a cache. There are pros and cons for example if someone removes cache there then suddenly this would loose caching behavior and also this having its own cache frees up the other cache. Should I add it back ?
|
@remilapeyre yes, agreed I avoid moving methods around but in this case the is_private method was deleted from child classes and moved to the base class and the overlap method was moved closer to the subnet_of and supernet_of functions because overlap and them are related terms and the overlap method simply delegates the call to these two methods. I thought this small refactor will help greatly with future readability of the code. what do you think ? should I put it in the old place ? |
|
The following commit authors need to sign the Contributor License Agreement: |
|
This PR is stale because it has been open for 30 days with no activity. |
https://bugs.python.org/issue38335