bool type have big problem. finally program returned "True".Is this the TRUE spec?

Liste des GroupesRevenir à cl python 
Sujet : bool type have big problem. finally program returned "True".Is this the TRUE spec?
De : deqser25 (at) *nospam* gmail.com (あうぇくろ)
Groupes : comp.lang.python
Date : 18. Jan 2025, 13:55:56
Autres entêtes
Message-ID : <mailman.92.1737391296.2912.python-list@python.org>
References : 1
from typing import List
from types import FunctionType, LambdaType


def composite(*func: List[FunctionType]) -> LambdaType:
if len(func) < 2:
raise TypeError(f'composite expected over 2 arguments, but got {len(func)}')
if len(func) == 2:
return lambda *args, **kwargs: func[1](func[0](*args, **kwargs))

return lambda *args, **kwargs: composite(*func[1:])(func[0](*args, **kwargs
))
tpr=composite(type,print)
print(tpr('a')==tpr(1))

I subscribed to python-list, so I sent this message again.
Why does tpr('a')==tpr(1) return True?

Date Sujet#  Auteur
18 Jan 25 * bool type have big problem. finally program returned "True".Is this the TRUE spec?2あうぇくろ
20 Jan 25 `- Re: bool type have big problem. finally program returned "True".Is this the TRUE spec?1Alan Bawden

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal