From 234cb5610b81f72fb5744ac8821f065ccfdfa0c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Thu, 17 Apr 2025 19:55:32 +0200 Subject: [PATCH] Reverted repr() use cases --- index.html | 7 ++++--- parse.js | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/index.html b/index.html index fed2451..89dbbe4 100644 --- a/index.html +++ b/index.html @@ -844,10 +844,11 @@ csv.writer(<file>).writerow([<obj>]) raise Exception(<obj>) -

Expressions that call the repr() method:

print/str/repr([<obj>, ...])
-print/str/repr({<obj>: <obj>, ...})
-Z = make_dataclass('Z', ['a']); print/str/repr(Z(<obj>))
+

Expressions that call the repr() method:

print/str/repr([<obj>])
+print/str/repr({<obj>: <obj>})
 f'{<obj>!r}'
+Z = make_dataclass('Z', ['a']); print/str/repr(Z(<obj>))
+>>> <obj>
 

Inheritance

class Person:
diff --git a/parse.js b/parse.js
index f075167..7e38b93 100755
--- a/parse.js
+++ b/parse.js
@@ -80,10 +80,11 @@ const PARAMETRIZED_DECORATOR =
   '    return x + y\n';
 
 const REPR_USE_CASES =
-  'print/str/repr([<obj>, ...])\n' +
-  'print/str/repr({<obj>: <obj>, ...})\n' +
+  'print/str/repr([<obj>])\n' +
+  'print/str/repr({<obj>: <obj>})\n' +
+  'f\'{<obj>!r}\'\n' +
   'Z = make_dataclass(\'Z\', [\'a\']); print/str/repr(Z(<obj>))\n' +
-  'f\'{<obj>!r}\'\n';
+  '>>> <obj>\n';
 
 const CONSTRUCTOR_OVERLOADING =
   'class <name>:\n' +