Skip to content

Negative indices don't work as I would expect #51

@Narkhelek

Description

@Narkhelek

If I try to use a negative indice it subtracts from the IP subnet instead of returning an IP from the end of netblock.

For example:

foo1 = ipcalc.Network('192.243.234.0/29')
print foo1[-1]
192.243.233.255

I would expect it to return 192.243.234.7 which is the last IP in the 192.243.234.0/29 netblock.

This may be working as expected but it would be very handy to be able to indices IPs from the end of the subnet moving toward the beginning.

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions