* possibly use the GIL to make the link updates atomic, trying to make the overall class thread safe. * avoid any reference cycles so that dicts can clean-up right-away when their ref-count drops to zero * ensure that _init_() can reset and populate an existing dictionary:ĭ=OrderedDict() d=1 d._init_() # resets Regardless, I'm being careful to get this right and I'm no expert with the C-API, so it's taking a while. As well, I plan on improving the subclass-ability of the type once it's otherwise happy.Īny feedback at the point would be helpful. I see room for efficiency improvements in a couple spots. Once everything is sorted out I'll plug my implementation of the iterators back in (which I'd already mostly finished). One key thing is that for now the various iterators are faked using lists. At this point it passes all the main unit tests (segfaults in some of the supplemental Mapping tests). I still have some ref-counting issues, but the patch is much closer to what I expect will be the final version. * the default implementation will be coming via _collections. > What's the reason for moving the OrderedDict tests in a separate file?įollowing the precedent of que and faultdict: What's the reason for moving the OrderedDict tests in a separate file? Here's a cleanup of test.test_collections that helps keep the subsequent patch (still forthcoming) cleaner. Once I have cleared up reference counting issues I'll put up a new patch. The tests should probably be updated to use the PEP 399 idiom in order to test both the implementations.ĭate: Yeah, I've fixed Good point. Nit: This really not be exposed through _collections rather than hacked into builtins. ![]() Note: this first patch has some reference leaks that I'm tracking down.Īuthor: Benjamin Peterson (benjamin.peterson) * The ultimate goal for this type is to use it for **kwargs. However, I'm pretty sure that I have most everything correct. My experience with the C-API is relatively limited and my C-fu is not at a professional level. The spot in the builtins is mostly for convenience, but I expect it will need to be exposed somewhere (perhaps _collections?). I'm getting this up now to get some eyes on it. Though, the implementation is not heavily optimized and isn't super subclass-friendly, my hope is that it's relatively close to the final version. Here's an initial stab at writing OrderedDict in C. 21:39:06 INFO (MainThread) Timer:startingĪutomation/update_gps.Arfrever, BreamoreBoy, Jim.Jewett, Mark.Shannon, alex, asvetlov, benjamin.peterson, christian.heimes, eric.araujo, eric.smith, eric.snow, lotti, flox, gregory.p.smith, introom, josh.r, larry, mrabarnett, ncoghlan, ned.deily, pitrou, python-dev, refi64, rhettinger, scoder, serhiy.storchaka, skrah, tonn81, westurner, yselivanovĬreated on 04:08 by eric.snow, last changed 14:57 by admin. 21:39:06 INFO (MainThread) Starting Home Assistant 21:39:06 ERROR (MainThread) Error loading /config/configuration.yaml: invalid key: "OrderedDict()" In "/config/automation/update_gps.yaml", line 26, column 0 ![]() 21:39:06 ERROR (SyncWorker_0) invalid key: "OrderedDict()" HA will freeze on restart if this is in my automation.yaml The conditions are my attempt to not update if the GPS is not available or if I have not moved more than 20km away. ![]() Occasionally, GPS is not available depending on where I am at the time. I travel full-time in an RV and move on any given day so trying to set it up to update every day at 1 am. I am trying to set up an automation to use the new set_location service.
0 Comments
Leave a Reply. |