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


Groups > comp.lang.python > #105868 > unrolled thread

Re: Suggestion: make sequence and map interfaces more similar

Started byMark Lawrence <breamoreboy@yahoo.co.uk>
First post2016-03-27 20:24 +0100
Last post2016-03-27 20:24 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#105868 — Re: Suggestion: make sequence and map interfaces more similar

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2016-03-27 20:24 +0100
SubjectRe: Suggestion: make sequence and map interfaces more similar
Message-ID<mailman.93.1459106717.28225.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web