Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
zero referenced object
#1
once an object is no longer referenced, it can eventually be deleted. i see that, at least for CPython, this really does get delayed. is there a way to speed this up, at least for one specific object?
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#2
Eli Holderness - Pointers? In my Python? It's more likely than you think
Reply
#3
unfortunately, i don't have time, right now, to watch that whole video. maybe later tonight.

i have heard that Python calls these references, not pointers, so i am wondering why she is calling them pointers.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply
#4
You can manually run a garbage collection
import gc
gc.collect()
Relevant use cases for this don't seem easy to built. One would need a situation where huge or numerous instances' deallocation is postponed by the automatic garbage collector.

If I had this statement in my code, I'd rather investigate if I'm misunderstanding something.
Reply
#5
it is deletion by garbage collection that seems to be happening. i just wanted to handle exceptions in __del__(). i'm looking at the issues i run into many different ways, hence many questions to fully understand the details of what is happening.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020