> > instead of prefixing a letter, we may be able to omit the key of > items inside dict display.
d = {:name, :addr, ’tel': '123-4567’} > This is my favorite variation on the notation so far. I'll give it a +1 On Wed, Jun 10, 2020 at 10:49 AM Atsuo Ishimoto <ishim...@python.jp> wrote: > Hi > Thank you for comments > > 2020年6月10日(水) 12:12 Stephen J. Turnbull < > turnbull.stephen...@u.tsukuba.ac.jp>: > > DTRTs. How often would locals() be usable in this way? Note: in the > > case of requests, this might be a vulnerability, because the explicit > > dict display would presumably include only relevant items, while > > locals() might inherit private credentials from the arguments, which > > need to be explicitly del'ed from d. > > And in case of locals() is useful, the code may eventually become > unsafe someday later. > > > I understand that this was done for ease of your POC implementatation, > > and you prefer a letter. But I'd like to emphasize: Please don't use > > $ for this. Among other things, it is both in appearance and > > historically based on "S" for "set"! > > > > I don't like it, either. But choice of valid letters are limited to > such as “$", "'" and "?". > So I think '$' is the best choice among these letters ;) > > > Also, please use dict display syntax (':' not '='). > > > > Ah, this is a typo. I use ':' in my implementation. > > > If you're going to use prefix characters, I suggest 'd' for "dict", > > and maybe 's' for "set" as well (to allow the use case 's{}' for the > > empty set, though that's not terribly useful vs. set(). I'm mostly > > proposing it so I be the first to say "-1" on 's{}'. :-) > > > > 'd{}' would be a nice choice. > > > > It occurs to me there's an alternative syntax with even less notation: > > > > d = {'tel' : '123-456-789', first, last, addr1, addr2} > > > > This is acceptable, but I prefer prefixed dict better. > > Or, instead of prefixing a letter, we may be able to omit the key of > items inside dict display. > > d = {:name, :addr, ’tel': '123-4567’} > > Thoughts? > _______________________________________________ > Python-ideas mailing list -- python-ideas@python.org > To unsubscribe send an email to python-ideas-le...@python.org > https://mail.python.org/mailman3/lists/python-ideas.python.org/ > Message archived at > https://mail.python.org/archives/list/python-ideas@python.org/message/6Y3NSEBKALWJSB63MWMXRA6KTZ46CMD3/ > Code of Conduct: http://python.org/psf/codeofconduct/ >
_______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/RNKJWIYYWFXEWJGBWCI47CY7RVDMY26H/ Code of Conduct: http://python.org/psf/codeofconduct/