Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #105868

Re: Suggestion: make sequence and map interfaces more similar

From Mark Lawrence <breamoreboy@yahoo.co.uk>
Newsgroups comp.lang.python
Subject Re: Suggestion: make sequence and map interfaces more similar
Date 2016-03-27 20:24 +0100
Message-ID <mailman.93.1459106717.28225.python-list@python.org> (permalink)
References <CABbU2U_DsSC=6d0HOwgGnzQZ0=r6U2sf_zOJP0U_w7_i0RrOKQ@mail.gmail.com> <CABbU2U-SEWhOR-D4P2tiwJ3OUnpjz2LBzzqjyo2+guzjwcwddw@mail.gmail.com>

Show all headers | View raw


On 27/03/2016 19:01, Marco S. via Python-list wrote:
>
> Mark Lawrence wrote:
>
>> I cannot see this happening unless you provide a patch on the bug
>> tracker.  However I suspect you can get the same thing by subclassing
>> dict.  Why don't you try it and let us know how you get on?
>
> The problem with a vdict is that I should also create by zero a new
> interface (ABC), since MutableMapping have an incompatible contract.
> And to be much more useful I should code it inc C, and my C skills are
> not so magnificent. Furthermore I would try to create a new sequence
> interface that inherit from the vdict interface. More briefly, I need
> much free time. But I suppose I can start with something quick and
> dirty.
>

Why do you need a new interace if all you're trying to do is create a
vdict class that has "iter(d) == iter(d.values()), and should also
have a count() method, like sequence types"?

I don't understand why you think you need C skills.  E.g. 
SortedContainers https://pypi.python.org/pypi/sortedcontainers "is an 
Apache2 licensed containers library, written in pure-Python, and fast as 
C-extensions."

I think your quick and dirty might well turn into something useful for 
your application.

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Suggestion: make sequence and map interfaces more similar Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-27 20:24 +0100

csiph-web