[issue33947] Dataclasses can raise RecursionError in __repr__

2018-10-19 Thread Eric V. Smith


Change by Eric V. Smith :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33947] Dataclasses can raise RecursionError in __repr__

2018-10-19 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset b9182aa7dad8991fc8768ae494b45b5f7c316aca by Eric V. Smith (Miss 
Islington (bot)) in branch '3.7':
bpo-33947:  dataclasses no longer can raise RecursionError in repr (GF9916) 
(#9970)
https://github.com/python/cpython/commit/b9182aa7dad8991fc8768ae494b45b5f7c316aca


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33947] Dataclasses can raise RecursionError in __repr__

2018-10-19 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9315

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33947] Dataclasses can raise RecursionError in __repr__

2018-10-16 Thread Srinivas Reddy T


Change by Srinivas  Reddy T :


--
keywords: +patch
pull_requests: +9273
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33947] Dataclasses can raise RecursionError in __repr__

2018-10-01 Thread Eric V. Smith


Change by Eric V. Smith :


--
assignee:  -> eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33947] Dataclasses can raise RecursionError in __repr__

2018-09-23 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33947] Dataclasses can raise RecursionError in __repr__

2018-06-23 Thread Eric V. Smith


Eric V. Smith  added the comment:

Thanks, Raymond. I'm working on a patch.

--
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33947] Dataclasses can raise RecursionError in __repr__

2018-06-23 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

We have a tool designed for this problem.  See: 
https://docs.python.org/3/library/reprlib.html#reprlib.recursive_repr

If you want to avoid a dependency, it is easy to inline the logic.  For an 
example, see the Python 2.7 version of collections.OrderedDict.__repr__.

--
nosy: +rhettinger
priority: low -> normal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33947] Dataclasses can raise RecursionError in __repr__

2018-06-23 Thread Rémi Lapeyre

Rémi Lapeyre  added the comment:

This seems like a difficult problem to tackle in all cases, if two dataclasses 
reference each other the cycle could be complex to identify and introduce 
complexity.

The way repr is defined is part of PEP 557 and actually force this behavior.

Should the `repr` parameter default to False or not include the repr of each 
field?

--
nosy: +remi.lapeyre

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33947] Dataclasses can raise RecursionError in __repr__

2018-06-23 Thread Eric V. Smith


New submission from Eric V. Smith :

>>> @dataclass
... class C:
...   f: "C"
...
>>> c = C(None)
>>> c.f = c
>>> c
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in __repr__
  File "", line 2, in __repr__
  File "", line 2, in __repr__
  [Previous line repeated 328 more times]
RecursionError: maximum recursion depth exceeded
>>>

It would be better to produce "C(f=...)".

--
components: Library (Lib)
messages: 320305
nosy: eric.smith
priority: low
severity: normal
status: open
title: Dataclasses can raise RecursionError in __repr__
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com