[issue44674] dataclasses should allow frozendict default value
Gianni Mariani added the comment: Excellent. Thanks! -- ___ Python tracker <https://bugs.python.org/issue44674> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44674] dataclasses should allow frozendict default value
New submission from Gianni Mariani : Using a frozendict as a default value should not cause an error in dataclasses. The check for mutability is: isinstance(f.default, (list, dict, set)) It appears frozendict has been changed to have a dict base class and it now raises an exception. There should be a way to indicate object mutability as the purpose of the isinstance(f.default, (list, dict, set)) check is for mutable default values. Using default_factory to work around this issue is cumbersome. -- components: Library (Lib) messages: 397799 nosy: gianni priority: normal severity: normal status: open title: dataclasses should allow frozendict default value type: compile error versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue44674> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue44674] dataclasses should allow frozendict default value
Gianni Mariani added the comment: @Arjun - this is about default values (See the bug description - Using a frozendict as a default value) Try this: from frozendict import frozendict from dataclasses import dataclass @dataclass class A: a: frozendict = frozendict(a=1) This used to work until frozendict became a subclass of dict. Perhaps another fix is to convert any dict to a frozendict? Maybe not. How would you handle this case? The only thing I figured was: from frozendict import frozendict, field from dataclasses import dataclass AD=frozendict(a=1) @dataclass class A: a: frozendict = field(default_factory=lambda:AD) Which imho is cumbersome. -- ___ Python tracker <https://bugs.python.org/issue44674> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40586] Pydoc should support https for hyperlinks.
New submission from Gianni Mariani : pydoc has a regex hard coded for supporting hyperlinks. It supports http and ftp. It should support https. -- components: Demos and Tools messages: 368601 nosy: owebeeone priority: normal severity: normal status: open title: Pydoc should support https for hyperlinks. versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue40586> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40586] Pydoc should support https for hyperlinks.
Change by Gianni Mariani : -- type: -> enhancement ___ Python tracker <https://bugs.python.org/issue40586> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com