Sujet : Re: IDLE: clearing the screen
De : ram (at) *nospam* zedat.fu-berlin.de (Stefan Ram)
Groupes : comp.lang.pythonDate : 10. Jun 2024, 16:32:41
Autres entêtes
Organisation : Stefan Ram
Message-ID : <repr-20240610153216@ram.dialup.fu-berlin.de>
References : 1 2 3
"Michael F. Stemper" <
michael.stemper@gmail.com> wrote or quoted:
On 08/06/2024 14.18, Rob Cliffe wrote:
OK, here is the advanced version:
import os
class _cls(object):
def __repr__(self):
os.system('cls')
return ''
cls = _cls()
...
Why have it return anything at all?
Because __repr__ needs to return a str.