On 2021-09-18 16:10, Serhiy Storchaka wrote:
18.09.21 09:40, Marco Sulla пише:
Ooook. I have a question. Why is this code not present in
dictobject.c? Where are the dict annotations implemented?
In dictobject.c.
I just had a look at dictobject.c. It too has a cast to PyCFunction.
--
http
On 2021-09-18 16:09, Serhiy Storchaka wrote:
18.09.21 03:54, MRAB пише:
static PyMethodDef customdict_methods[] = {
...
{"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_CLASS |
METH_O | METH_COEXIST, PyDoc_STR("See PEP 585")},
...
};
Note the flags: METH_CLASS says that it's a clas
On Sun, Sep 19, 2021 at 11:46 AM Mostowski Collapse wrote:
>
> Yeah, it seems weak references could indeed spare
> me mark_term(). But then I am stil left with sweep_trail().
> I did not yet measure what takes more time mark_term()
> or sweep_trail(). The displayed "gc" is the sum of both.
>
> Fro
18.09.21 09:40, Marco Sulla пише:
> Ooook. I have a question. Why is this code not present in
> dictobject.c? Where are the dict annotations implemented?
In dictobject.c.
--
https://mail.python.org/mailman/listinfo/python-list
18.09.21 03:54, MRAB пише:
> static PyMethodDef customdict_methods[] = {
> ...
> {"__class_getitem__", (PyCFunction)Py_GenericAlias, METH_CLASS |
> METH_O | METH_COEXIST, PyDoc_STR("See PEP 585")},
> ...
> };
>
>
> Note the flags: METH_CLASS says that it's a class method and
> METH_COEXIST sa
Stefan Ram wrote:
> Robert Latest writes: But how can I "promote" a
>>given Opaque instance to the derived class?
>
> Sometimes, one can use containment instead of inheritance.
Nah, doesn't work in my case. I'm trying to write a wrapper around
xml.etree.ElemenTree and .Element to circu
On 16/09/21 6:13 am, Mostowski Collapse wrote:
So in Python I now do the following:
peek = kb.get(functor, NotImplemented)
if peek is not NotImplemented:
If you're able to use None instead of NotImplemented, you
could simplify that to
peek = kb.get(functor)
if peek:
..
Yeah, it seems weak references could indeed spare
me mark_term(). But then I am stil left with sweep_trail().
I did not yet measure what takes more time mark_term()
or sweep_trail(). The displayed "gc" is the sum of both.
>From what I have seen, very large trail practically reduced
to a zero trail
On 17/09/21 8:41 pm, Mostowski Collapse wrote:
Are exceptions
blocks in Python cheap or expensive? Are they like
in Java, some code annotation, or like in Go
programming language pushing some panic handler?
They're not free, but they're not hugely expensive either.
Don't be afraid to use them w
On 17/09/21 7:56 am, Mostowski Collapse wrote:
The trail in Dogelog
Runtime is a single linked list:
-->[ A ]-->[ B ]-->[ C ]-->
Now if B becomes unused, you need to rewire
the trail, it should then look like:
-->[ A ]-->[ C ]-->
Python has a way of creating weak references
On 16/09/2021 19.11, Alan Gauld wrote:
On 16/09/2021 06:50, af kh wrote:
Hello,
I was doing some coding on a website called replit
I have no idea what that is but...
after answering 'no' or 'yes' after the last sentence I wrote,
the Python window shut off,
That's what you told it to do in
Hi all, let's assume I'm using a module that defines some class "Opaque" and
also a function that creates objects of that type. In my program I subclass
that type because I want some extra functionality. But how can I "promote" a
given Opaque instance to the derived class? Of course I could just cr
How to Create Upside Down text in Python!!!
This is a very simple yet very interesting program in python.
We are going to make our text, word or string UPSIDE DOWN which will be still
readable on phone or desktop if you stand on your head lol.
But any ways... lets do a little research first.
13 matches
Mail list logo