sympy also builds a language on top of Python.
pandas also builds a language on top of Python.

Is there some pope that says this wouldn't be
allowed, I dont think so, otherwise sympy, pandas, etc..

wouldn't exist. I dont understand your argument.

Chris Angelico schrieb:
On Mon, Sep 20, 2021 at 3:19 AM Mostowski Collapse <janbu...@fastmail.fm> wrote:

I am refering to:

Greg Ewing schrieb:
  > where [w] is a weak reference object. Then you could periodically
  > scan the trail looking for dead weakref objects and remove the
  > corresponding [*] node from the list.
  >
  > You can also attach callbacks to weakref objects that are triggered
  > when the referenced object dies. You might be able to make use of
  > that to remove items from the trail instead of the periodic scanning.

Question to Chris Angelico: If I stay with my
sweep_trail(), which is the periodically scanning,
I can use a single linked list.

On the other hand if I would use the trigger
from Python, I possibly would need a double linked
list, to remove an element.

Chris Angelico, is there a third option, that I have
overlooked? Single linked list uses less space
than double linked list, this why I go with scan.


I don't know. I don't understand your code well enough to offer advice
like that, because *your code is too complicated* and not nearly clear
enough.

But however it is that you're doing things, the best way is almost
always to directly refer to objects. Don't fiddle around with creating
your own concept of a doubly-linked list and a set of objects; just
refer directly to the objects. Let Python be Python, don't try to
build your own language on top of it.

ChrisA


--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to