(May-18-2019, 06:25 AM)perfringo Wrote: EDIT: This question intrigued me, so I went to github to check from rangeobject.c how len of range determined. My knowledge of C is next to none, but:
the point is that it was implemented with C types. to make it work even higher, it needed to be calling the extended precision int code, like it would have to be doing for lots of other things like actual arithmetic -or- implement just the len() part in Python and have the C code call that. i doubt len() would be called too often to consider it a critical point.
slicing a network object would be the next thing. applying
[:16]
or [-32:]
would get a list of one network and applying [8:24]
would get a list of two networks since CIDR cannot span that range. or, they implement a network range type object. they did implement the "in" operation, at least for addresses in a network. i should test if network "in" network works.i am thoroughly familiar with networks and have implement some of this stuff in C. maybe i should implement a subclass with these many added features (just in Python, not C).
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.