A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2019-April/157168.html below:

[Python-Dev] Proposal: dict.with_values(iterable)

[Python-Dev] Proposal: dict.with_values(iterable) [Python-Dev] Proposal: dict.with_values(iterable)Inada Naoki songofacandy at gmail.com
Tue Apr 23 11:53:10 EDT 2019
On Wed, Apr 24, 2019 at 12:28 AM Steve Dower <steve.dower at python.org> wrote:
>
> >
> > But if the original dictionary wasn't created with shared keys... the
> > copy can't share them either.  Or are you suggesting adding new code to
> > create a shared key dictionary from one that isn't?
>
> This is a good point. Maybe dict.fromkeys() could do it? Or a
> sys.intern-like function (which is why I brought up that precedent). The
> point is to make it an optional benefit rather than strict
> language/library semantics.
>

Then, why not support values when creating key sharing dict?
That's one form of my proposal :)

-- 
Inada Naoki  <songofacandy at gmail.com>
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4