Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Shay Nehmad
    @ShayNehmad
    Hey, wondering about Python 3.7 support. We've ran into this exception in our testing:
    TypeError: '_MethodRope' object is not callable
    Any clues?
    Also just wanted to say thanks for the project, hugely useful for our project (InfectionMonkey)
    Jeong YunWon
    @youknowone
    hey welcome. do you have any small code snippet to reproduce the problem?
    Jeong YunWon
    @youknowone
    i just looked around infection monkey and it looks great
    VakarisZ
    @VakarisZ
    Hi. Thanks, we're trying :) I created a small snipet that gives me error: https://pastebin.com/wptBDqvq
    Jeong YunWon
    @youknowone
    Thanks, i will look into this code and errors
    Jeong YunWon
    @youknowone
    Oh… i am sorry that i couldn’t find the issue earlier
    the ring decorator must be top of the staticmethod/classmethod decorator
    hmm, i want to make ring raise better error message for that but no simple idea
    for the example, switching the ring.lru and staticmethod will fix the problem
    Jeong YunWon
    @youknowone
    if it doesn't need to create an instance, just creating __ring_key__ as a staticmethod or classmethod will solve the self problem
    Shay Nehmad
    @ShayNehmad
    @youknowone, if the usage of __ring_key__ is expected of users, then why is it using the "name scrambling"/"private" naming scheme? Is overriding the __ring_key__ the "idiomatic" way of using ring?
    And thanks for checking out Infection Monkey, if there's anything you'd like to know further you can join our chat over at slack or go to infectionmonkey.com to check it out :)
    Jeong YunWon
    @youknowone
    when we are caching a class object, yes for now. i am thinking of using string hash of repr (only when it is user-defined) for out-of-python storages and using python __hash__ for in-python storages as default, but not sure about it yet.
    class object -> user-defined object
    what was the input type? i wonder which case do you cache a class instead of instance, which is not automatically stringified with type stringifier
    VakarisZ
    @VakarisZ
    Hey. Thanks for being great help! Unfortunatelly I've got a problem that I could pin-point to ring. The problem is that I get the same result regardless of which ObjectId I pass in:
    image.png
    image.png
    ^ Here I pass in just a random ObjectId(should get exception returned from function) but still get the same result
    __str__() and __hash__() of different ObjectId returns different strings (I checked)
    This also seems to work fine with vanilla functools.lru_cache (don't get the same cached result with any ObjectId)
    This is the cached function:
    VakarisZ
    @VakarisZ
    image.png
    Jeong YunWon
    @youknowone
    does objectid return different ring key by the value?
    VakarisZ
    @VakarisZ
    __ring_key__()? It's bson.ObjectId. It doesn't have ring key
    Jeong YunWon
    @youknowone
    let me look into it whats happened
    VakarisZ
    @VakarisZ
    Ok, tell me if you're unable to reproduce :)
    Jeong YunWon
    @youknowone
    @VakarisZ will you give me test code?
    i didn’t see any problem with using object id as string with that code
    Look here. I get a problem on this code
    Jeong YunWon
    @youknowone
    hmm indeed
    VakarisZ
    @VakarisZ
    I tried to debug, but I don't understand a thing in there :D Maybe I missed something obvious?
    Jeong YunWon
    @youknowone
    ok i found problem. there is a bug with staticmethod
    VakarisZ
    @VakarisZ
    Great! Is it on our end? Can we fix it?