binkle,
@binkle@clubcyberia.co avatar

an entire day devoted to finding out "yeah no this function does nothing and it never will" :pleadhelp:

MMS21,
@MMS21@seal.cafe avatar

You and rustycrab’s work at the eternal ball sack destruction factory

hazlin,
@hazlin@shortstacksran.ch avatar

@binkle
def binkle_function(**args):
>>>pass

karna,
@karna@poa.st avatar

@hazlin @binkle ```
def _(**kwargs):
...

hazlin,
@hazlin@shortstacksran.ch avatar

@karna @binkle ahhh, that killed the last value feature in my long running RPEL xD

karna,
@karna@poa.st avatar

@hazlin @binkle Doesnt it get reassigned after your next assignment? Or maybe you need to do

del _

?

hazlin,
@hazlin@shortstacksran.ch avatar

@karna @binkle that worked!

I didn't know del was a thing in python...

karna,
@karna@poa.st avatar

@hazlin @binkle Trust me when I say manual garbage collection in python is not a fun rabbit hole, especially venturing beyond del

binkle,
@binkle@clubcyberia.co avatar

@karna @hazlin coming from a world where C/C++ is the norm, something about the phrase "manual garbage collection" makes my skin itch

hazlin,
@hazlin@shortstacksran.ch avatar

@binkle @karna
> garbage collection

Oh you mean like when you fork a clean new process, and halt the current iteration?

karna,
@karna@poa.st avatar

@binkle @hazlin Such is life in the carnival of horrors that is python. Im not going to get into the details but roughly speaking theres reference counting being done to inform the automatic garbage collection, but when that isn't suitable (think reference cycles, the collector not being called soon enough when left to its own devices, etc.), you could, for example, do some simple manual garbage collection by calling the python's garbage collector manually (hence manual garbage collection)

import gc

gc.collect()

# or disable it entirely with
gc.disable()

PS I hate python

hazlin,
@hazlin@shortstacksran.ch avatar

@karna @binkle huh, I had assumed that, reference counting meant that you didn't have a separate gc event.

For example, every time you deference, and there for, decrement the counter, there was a check to see if it was zero.

karna,
@karna@poa.st avatar

@hazlin @binkle I'll be honest, I'm getting out of my depth but I would assume there is a deallocation when the reference count of an object hits 0 it would be deallocated (assuming no cyclical references) but this is python, so for all I know the deallocations of objects with 0 reference counts might be queued up and done at certain moments. The gc.collect call is more to try and force collection of objects that have cyclical references that may no longer be valid references (look up generational thresholds or variations of that alongside python to find more info on that)

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • Hentai
  • doujinshi
  • announcements
  • general
  • All magazines