[issue37119] Equality on dict.values() are inconsistent between 2 and 3
New submission from 林自均 : When I create 2 different dicts with the same literal, their dict.values() are equal in python2 but not equal in python3. Here is an example in python2: $ python2 Python 2.7.16 (default, Mar 4 2019, 09:02:22) [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> a = {'hello': 'world'} >>> b = {'hello': 'world'} >>> a.values() == b.values() True >>> a.keys() == b.keys() True However, the dict.values() are not equal in python3: $ python3 Python 3.7.2 (default, Feb 12 2019, 08:16:38) [Clang 10.0.0 (clang-1000.11.45.5)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> a = {'hello': 'world'} >>> b = {'hello': 'world'} >>> a.values() == b.values() False >>> a.keys() == b.keys() True Is this a bug? Or is this behavior specified somewhere in the documentation? Thanks. Note: it's inspired by this StackOverflow question: https://stackoverflow.com/questions/56403613/questions-about-python-dictionary-equality -- components: Library (Lib) messages: 344145 nosy: johnlinp priority: normal severity: normal status: open title: Equality on dict.values() are inconsistent between 2 and 3 type: behavior versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue37119> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue37119] Equality on dict.values() are inconsistent between 2 and 3
林自均 added the comment: Hi Karthikeyan and Serhiy, Thank you for the explanation. I'll check the references you gave me. -- ___ Python tracker <https://bugs.python.org/issue37119> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34763] Python lacks 0x4E17
林自均 added the comment: "丗" means "30" in Japanese. However, it is a variant Chinese character to "世", where "世" means "world" in Chinese. I'm not sure if this information makes any difference. -- nosy: +johnlinp ___ Python tracker <https://bugs.python.org/issue34763> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22253] ConfigParser does not handle files without sections
林自均 added the comment: Hi Pedro Lacerda, I think you should submit your patch as a GitHub pull request. Please correct me if I'm wrong. Thanks. -- nosy: +林自均 ___ Python tracker <http://bugs.python.org/issue22253> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31528] Let ConfigParser parse systemd units
New submission from 林自均: Although systemd units are inspired by .ini format, ConfigParser is unable to parse those files because: 1. Multiple assignments to the same option in systemd units are concatenated with white spaces. 2. Multiple sections with the same section name are merged. 3. An option assignment of empty value resets the option. I suggest 3 corresponding parameters in ConfigParser.__init__(): 1. merge_options: If set to True, multiple assignment to the same option are concatenated with white spaces. Default is False. 2. merge_sections: If set to True, multiple sections with the same name are merged. Default is False. 3. empty_is_reset: Only relevant when merge_options is True. If set to True, an option assignment of empty value will reset the option. Default is False. -- components: Library (Lib) messages: 302604 nosy: johnlinp priority: normal severity: normal status: open title: Let ConfigParser parse systemd units type: enhancement versions: Python 3.7 ___ Python tracker <https://bugs.python.org/issue31528> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36639] Provide list.rindex()
New submission from 林自均 : There are str.index() and str.rindex(), but there is only list.index() and no list.rindex(). It will be very handy if we provide it. -- components: Library (Lib) messages: 340312 nosy: johnlinp priority: normal severity: normal status: open title: Provide list.rindex() type: enhancement versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue36639> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36639] Provide list.rindex()
Change by 林自均 : -- keywords: +patch pull_requests: +12776 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36639> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36639] Provide list.rindex()
林自均 added the comment: Hi @SilentGhost, Thank you for the feedback. The PR is only a WIP and a placeholder. Hi @xtreak, Thank you for searching that mailing list for me. However, after reading the thread, it seems that we didn't have any conclusion on whether we should add list.rindex() or not. Did I miss something? -- ___ Python tracker <https://bugs.python.org/issue36639> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36639] Provide list.rindex()
林自均 added the comment: Hi @rhettinger , Thank you for the reply. May I ask what is the known, strong use cases for str.rindex()? -- ___ Python tracker <https://bugs.python.org/issue36639> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36639] Provide list.rindex()
林自均 added the comment: >From the discussion in >https://mail.python.org/pipermail/python-ideas/2019-April/056416.html, Guido >said: > Some use cases for rindex() on strings that I found in a large codebase here include searching a pathname for the final slash, a list of comma-separated items for the last comma, a fully-qualified module name for the last period, and some ad-hoc parsing of other things. The "last separator" use cases are the most common and here rindex() sounds very useful. I guess that's strong enough. -- ___ Python tracker <https://bugs.python.org/issue36639> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36639] Provide list.rindex()
林自均 added the comment: Hi @SilentGhost, Yes, sorry I didn't make it clear. I was just posting the discussion here for some reference, not claiming that this issue should be reopened. -- ___ Python tracker <https://bugs.python.org/issue36639> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com