Note that the x = 'x = {!r};print(x.format(x))';print(x.format(x)) pattern is described on the Rosetta Code page for quines. It’s possible that the trick is well known and that GPT4 was able to reach for it.
(I don’t know that I would call the resulting code copied. If I were given this prompt, the extra requirements would make me interpret it as a “show me you can fulfill these specific requirements” exercise rather than an exercise specifically about finding the trick. So, reaching for a pattern seems the appropriately level of lazy, the trick feels sufficiently less central to the question that I like the ‘applying a pattern’ label better than copying)
Note that the
x = 'x = {!r};print(x.format(x))';print(x.format(x))
pattern is described on the Rosetta Code page for quines. It’s possible that the trick is well known and that GPT4 was able to reach for it.(I don’t know that I would call the resulting code copied. If I were given this prompt, the extra requirements would make me interpret it as a “show me you can fulfill these specific requirements” exercise rather than an exercise specifically about finding the trick. So, reaching for a pattern seems the appropriately level of lazy, the trick feels sufficiently less central to the question that I like the ‘applying a pattern’ label better than copying)