[issue38525] Strange reversed dict behavior

2019-11-14 Thread Harmon
Change by Harmon : -- nosy: +Harmon758 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Closing this. Thanks, Dong-hee Na and everyone involved in the issue! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue38525] Strange reversed dict behavior

2019-10-19 Thread miss-islington
miss-islington added the comment: New changeset d73205d788a32148ba9a2beaa27badbd94ab65ff by Miss Islington (bot) in branch '3.8': bpo-38525: Fix a segmentation fault when using reverse iterators of empty dict (GH-16846) https://github.com/python/cpython/commit/d73205d788a32148ba9a2beaa27badb

[issue38525] Strange reversed dict behavior

2019-10-19 Thread miss-islington
Change by miss-islington : -- pull_requests: +16401 pull_request: https://github.com/python/cpython/pull/16853 ___ Python tracker ___ __

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: New changeset 24dc2f8c56697f9ee51a4887cf0814b6600c1815 by Pablo Galindo (Dong-hee Na) in branch 'master': bpo-38525: Fix a segmentation fault when using reverse iterators of empty dict (GH-16846) https://github.com/python/cpython/commit/24dc2f8c56697f

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Inada Naoki
Inada Naoki added the comment: When dict is empty, di_pos of reverse iterator must be -1, not 0. Additionally, di_pos must be initialized from ma_used when dict is key sharing dict. diff --git a/Objects/dictobject.c b/Objects/dictobject.c index 64876e0519..6c4b41700b 100644 --- a/Objects/dict

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: FYI c = A(0, 1) print(type(c.__dict__)) print(list(iter(c.__dict__))) print(list(reversed(c.__dict__))) works as we expected. -- ___ Python tracker __

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: > The proposed fix fixes a crash, but there is other bug in iterating shared > dicts. Yes, you are right. But I can not work on this issue today. (I have to finalize my paperwork by today :-() since priority is critical if other core developers finalize this iss

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The proposed fix fixes a crash, but there is other bug in iterating shared dicts. class A: def __init__(self, x, y): if x: self.x = x if y: self.y = y a = A(1, 2) print(list(iter(a.__dict__))) print(list(reversed(a.__dict__))) b = A(1,

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: > Wops, we made a PR at the same time, Dong-hee Na. lol > I will close mine :) Oh.. thank you for giving me a chance. -- ___ Python tracker _

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Pablo Galindo Salgado
Pablo Galindo Salgado added the comment: Wops, we made a PR at the same time, Dong-hee Na. I will close mine :) -- ___ Python tracker ___

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- nosy: +pablogsal, remi.lapeyre priority: normal -> critical ___ Python tracker ___ ___ Python-b

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Pablo Galindo Salgado
Change by Pablo Galindo Salgado : -- pull_requests: +16397 pull_request: https://github.com/python/cpython/pull/16847 ___ Python tracker ___ ___

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Change by Dong-hee Na : -- keywords: +patch pull_requests: +16396 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16846 ___ Python tracker ___

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: Can I take look at this issue? -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: >>> reversed({}.items()) >>> a = reversed({}.items()) >>> next(a) Assertion failed: (value != NULL), function dictreviter_iternext, file Objects/dictobject.c, line 3834. [1]4106 abort ./python.exe -- ___ Pyt

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Dong-hee Na
Dong-hee Na added the comment: This issue is related to reversed dict iter. >>> a = reversed({}) >>> next(a) Assertion failed: (value != NULL), function dictreviter_iternext, file Objects/dictobject.c, line 3834. [1]1366 abort ./python.exe -- nosy: +corona10 ___

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Karthikeyan Singaravelan
Change by Karthikeyan Singaravelan : -- nosy: +xtreak ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https:/

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Ned Deily
Ned Deily added the comment: Thanks for the report, by the way! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Ned Deily
Ned Deily added the comment: Outside of IDLE, the example causes a segfault. With debug build of current master HEAD: Assertion failed: (value != NULL), function dictreviter_iternext, file ../../source/Objects/dictobject.c, line 3834. if (d->ma_values) { if (i < 0) {

[issue38525] Strange reversed dict behavior

2019-10-19 Thread Ivan Bykov
New submission from Ivan Bykov : Python 3.8.0 (tags/v3.8.0:fa919fd, Oct 14 2019, 19:37:50) [MSC v.1916 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. >>> list(reversed({1: 1})) [1] >>> list(reversed({})) RESTAR