Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    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?
    Jeong YunWon
    @youknowone
    i will try to fix it. For now, using classmethod will temporarily hide the problem
    if it is urgent
    Shay Nehmad
    @ShayNehmad
    @youknowone Do you want us to open a ticket?
    We can also just use a regular function (outside of the scope of the class), right?
    Jeong YunWon
    @youknowone
    That is also true. creating a ticket is a good idea :) thanks!
    VakarisZ
    @VakarisZ
    Hey. Left a brief issue, thanks for the help again, you're awesome!
    Jeong YunWon
    @youknowone
    I think i found the problem
    I will test it and release a new version soon
    VakarisZ
    @VakarisZ
    Nice!
    Jeong YunWon
    @youknowone
    @ShayNehmad I made a few comments to guardicore/monkey#394
    Vioshim
    @Vioshim
    Hello people, is the library still being maintained?
    Jeong YunWon
    @youknowone
    @Krangelj hi, i didn't logged in gitter for a few days
    Do you have any question? or really want to know it is maintained in the meaning of under actual development
    Vioshim
    @Vioshim
    Oh it's alright, well yes I was wondering if the project was still under actual development
    and at the same time, I had a question towards how to use class functions which have "self" but realized that the lru function allows to do this.
    @lru(ignorable_keys=['self'])