honey-team / ufpy

Ufpy (Useful Python) - package for Python with some useful features
https://honey-team.github.io/ufpy-website
MIT License
3 stars 3 forks source link

UList #6

Open bleudev opened 5 months ago

bleudev commented 5 months ago

Add useful lists for simplification working with lists

first item is 1! (not 0)

l = UList(1, 9, 2)
l[1] # 1 not 9

l += 1
print(l) # [2, 10, 3]

l += [1,]
print(l) # [2, 10, 3, 1]

l2 = -l
print(l2) # [1, 3, 10, 2]

l3 = UList(2, 10, 9, 1)
print(l & l3) # [2, 10, None, 1]
print(l | l3] # [2, 10, 3, 9, 1]

And more!