MinekPo1 [it/she]

nya !!! :3333 gay uwu

I’m in a bad place rn so if I’m getting into an argument please tell me to disconnect for a bit as I dont deal with shit like that well :3

  • 0 Posts
  • 2 Comments
Joined 2 years ago
cake
Cake day: June 14th, 2023

help-circle
  • one small gripe i have is that the repr¹ doesn’t handle aliases (ie items with more than one bit set) that well , but tbh its not an easy problem

    example to illustrate the problem :

    class Foo(enum.Flag):
        A = auto()
        B = auto()
        C = auto()
        # no D
        AB = 0b0011
        CD = 0b1100
    
    print(Foo.AB | Foo.C)  # <Foo.A|B|C: 7> NOT <Foo.AB|C: 7>
    print(Foo.CD | Foo.A)  # <Foo.A|C|CD: 13> NOT <Foo.A|CD: 7>
    

    its a minor thing but it annoys me a bit

    [1]: the _name_ member , which is used by __repr__ , of an enum member is actually generated either when the individual enum class is created or when the value is first needed by _missing_ . also the docs call these names surrounded by single underscores “sunder” names