Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > move to end, in Python 3.2 Really?

Reply
Thread Tools

move to end, in Python 3.2 Really?

 
 
nn
Guest
Posts: n/a
 
      01-18-2011
On Jan 18, 12:20*am, Raymond Hettinger <(E-Mail Removed)> wrote:
> On Jan 17, 6:51*pm, nn <(E-Mail Removed)> wrote:
>
> > ...But the api on this baffles me a bit:

>
> > >>> d = OrderedDict.fromkeys('abcde')
> > >>> d.move_to_end('b', last=False)
> > >>> ''.join(d.keys)

>
> > 'bacde'

>
> > I understand that "end" could potentially mean either end, but would
> > "move_to_end" and "move_to_beginning" not have been clearer?

>
> The default (and normal usage) is to move an item to the last
> position.
> So, od.move_to_end(k) becomes a fast equivalent to v=d.pop(k)
> followed by d[k]=v.
>
> The less common usage of moving to the beginning is done with
> last=False. *This parallels the existing API for od.popitem():
>
> >>> od = OrderedDict.fromkeys('abcdefghi')
> >>> od.move_to_end('c') * * * * * * * # default case: *move to last
> >>> od.popitem() * * * * * * * * * * *# default case: *pop from last

> ('c', None)
> >>> od.move_to_end('d', last=False) * # other case: * *move to first
> >>> od.popitem(last=False) * * * * * *# other case: * *pop from first

>
> ('d', None)
>
> The existing list.pop() API is similar (though it takes an index
> value instead of a boolean):
>
> >>> mylist.pop() * * * * * * * * * * *# default case: *pop from last
> >>> mylist.pop(0) * * * * * * * * * * # other case: * *pop from first

>
> Those were the design considerations. *Sorry you didn't like the
> result.
>
> Raymond


Ah that is where it came from! I didn't remember popitem used that API
too. If you use them together it has a nice symmetry. I guess it is
just that "end" is more confusing than "pop" in that context.

Considering the precedence of popitem I withdraw my objection. I still
think it looks a bit odd but it is not unreasonable either. Sometimes
ugly consistency trumps beautiful inconsistency; c'est la vie...
 
Reply With Quote
 
 
 
 
Emile van Sebille
Guest
Posts: n/a
 
      01-18-2011
On 1/18/2011 9:10 AM rantingrick said...
> On Jan 18, 10:54 am, MRAB<(E-Mail Removed)> wrote:
>
>> Decisions are made after open discussion (although we're not sure about
>> "move to end" ). You shouldn't complain about not being consulted if
>> you don't take the time to join in...

>
> Well don't get wrong i want to join in --not that i have all the
> solutions-- however python-dev is a dangerous place for the
> uninitiated. And we can't have thousands and thousands of posts
> clogging up the main pool because that would only serve to slow the
> process to a grinding hault.
>
> However, we need some way that the average Python programmer can speak
> up and be heard when any subject that he/she is passionate about comes
> before the "council". These folks probably don't want to participate
> in the highly competitive environment of Python dev. However they may
> have very good ideas. I think we are doing this community a dis
> service by not giving these voices an outlet.
>
> We need either some way to vote outside of Python dev. i think it
> would be much easier to just have a site where all proposals can be
> viewed by anyone and they can offer input without clogging up Python
> dev with noob questions or bad ideas. Then the "council" can review
> these suggestions and make a more informed decision. Some might say
> "well that is what blogs and c.l.py is for" and i say wrong. I believe
> more folks would get involved if they felt that the medium was real.
> c.l.py is not that place (although it could be with some changes) and
> python.dev is not that place.
>
> I am open to any ideas you may have.



Brett Cannon used to (still does?) prepare twice monthly summaries of
activity on python-dev which provided insight as to what was happening
on that side of things. I don't know if he or anyone else still does
so, but if so, a copy to this list would at least let everyone know if
something was happening that you might want to weigh in on.

see http://article.gmane.org/gmane.comp.python.devel/43893

Emile

 
Reply With Quote
 
 
 
 
Antoine Pitrou
Guest
Posts: n/a
 
      01-18-2011
On Tue, 18 Jan 2011 10:33:45 -0800 (PST)
rantingrick <(E-Mail Removed)> wrote:
>
> On Jan 18, 11:56*am, Antoine Pitrou <(E-Mail Removed)> wrote:
> > On Tue, 18 Jan 2011 09:10:48 -0800 (PST)
> >
> > rantingrick <(E-Mail Removed)> wrote:
> >
> > > Well don't get wrong i want to join in --not that i have all the
> > > solutions--

> >
> > Take a look athttp://docs.python.org/devguide/#contributing

>
> Thanks for this link Antoine however i think you missed the point of
> my post.


You did say "I want to join in".

> What i would like to see is an forum where the "noob" to
> "average" python programmer can voice his/her opinion about the
> current state or future state of Pythons syntax, stdlib, goals and
> dreams, etc, al the while not fearing attack from all sides.


Well the only way for that to happen is to put it up yourself. Or to
gather some people around you to put it up together.

Regards

Antoine.


 
Reply With Quote
 
rantingrick
Guest
Posts: n/a
 
      01-18-2011
On Jan 18, 12:55*pm, Emile van Sebille <(E-Mail Removed)> wrote:
> On 1/18/2011 9:10 AM rantingrick said...
>
>
>
>
>
>
>
>
>
> > On Jan 18, 10:54 am, MRAB<(E-Mail Removed)> *wrote:

>
> >> Decisions are made after open discussion (although we're not sure about
> >> "move to end" ). You shouldn't complain about not being consulted if
> >> you don't take the time to join in...

>
> > Well don't get wrong i want to join in --not that i have all the
> > solutions-- however python-dev is a dangerous place for the
> > uninitiated. And we can't have thousands and thousands of posts
> > clogging up the main pool because that would only serve to slow the
> > process to a grinding hault.

>
> > However, we need some way that the average Python programmer can speak
> > up and be heard when any subject that he/she is passionate about comes
> > before the "council". These folks probably don't want to participate
> > in the highly competitive environment of Python dev. However they may
> > have very good ideas. I think we are doing this community a dis
> > service by not giving these voices an outlet.

>
> > We need either some way to vote outside of Python dev. i think it
> > would be much easier to just have a site where all proposals can be
> > viewed by anyone and they can offer input without clogging up Python
> > dev with noob questions or bad ideas. Then the "council" can review
> > these suggestions and make a more informed decision. Some might say
> > "well that is what blogs and c.l.py is for" and i say wrong. I believe
> > more folks would get involved if they felt that the medium was real.
> > c.l.py is not that place (although it could be with some changes) and
> > python.dev is not that place.

>
> > I am open to any ideas you may have.

>
> Brett Cannon used to (still does?) prepare twice monthly summaries of
> activity on python-dev which provided insight as to what was happening
> on that side of things. *I don't know if he or anyone else still does
> so, but if so, a copy to this list would at least let everyone know if
> something was happening that you might want to weigh in on.
>
> seehttp://article.gmane.org/gmane.comp.python.devel/43893
>
> Emile


That is dated 2002?

Thanks for offering a suggestion it was very welcome however i need to
emphasize that what i am proposing is sort of "community discussion
suggestion box". Like a "Python Suggestions" group or something. Where
any and all suggestions, rants, complaints, ideas, etc, are welcome
from anyone without fear of reprisals.

However, in order for this to succeed the "elite" must take the time
to actually read it. Maybe we could have some trusted "proof readers"
who could sift out the spam and useless stuff and then send a modified
version to the senate for congressional reviewing. Of course at that
point the senate can further narrow down the list before sending over
to the white house. This is the only way (short of sending out
warnings in the python releases) that you can actually get a feel for
what Joe and Jane Python programmer are happy with.

 
Reply With Quote
 
MRAB
Guest
Posts: n/a
 
      01-18-2011
On 18/01/2011 19:22, rantingrick wrote:
> On Jan 18, 12:55 pm, Emile van Sebille<(E-Mail Removed)> wrote:
>> On 1/18/2011 9:10 AM rantingrick said...
>>
>>> On Jan 18, 10:54 am, MRAB<(E-Mail Removed)> wrote:

>>
>>>> Decisions are made after open discussion (although we're not sure about
>>>> "move to end" ). You shouldn't complain about not being consulted if
>>>> you don't take the time to join in...

>>
>>> Well don't get wrong i want to join in --not that i have all the
>>> solutions-- however python-dev is a dangerous place for the
>>> uninitiated. And we can't have thousands and thousands of posts
>>> clogging up the main pool because that would only serve to slow the
>>> process to a grinding hault.

>>
>>> However, we need some way that the average Python programmer can speak
>>> up and be heard when any subject that he/she is passionate about comes
>>> before the "council". These folks probably don't want to participate
>>> in the highly competitive environment of Python dev. However they may
>>> have very good ideas. I think we are doing this community a dis
>>> service by not giving these voices an outlet.

>>
>>> We need either some way to vote outside of Python dev. i think it
>>> would be much easier to just have a site where all proposals can be
>>> viewed by anyone and they can offer input without clogging up Python
>>> dev with noob questions or bad ideas. Then the "council" can review
>>> these suggestions and make a more informed decision. Some might say
>>> "well that is what blogs and c.l.py is for" and i say wrong. I believe
>>> more folks would get involved if they felt that the medium was real.
>>> c.l.py is not that place (although it could be with some changes) and
>>> python.dev is not that place.

>>
>>> I am open to any ideas you may have.

>>
>> Brett Cannon used to (still does?) prepare twice monthly summaries of
>> activity on python-dev which provided insight as to what was happening
>> on that side of things. I don't know if he or anyone else still does
>> so, but if so, a copy to this list would at least let everyone know if
>> something was happening that you might want to weigh in on.
>>
>> seehttp://article.gmane.org/gmane.comp.python.devel/43893
>>
>> Emile

>
> That is dated 2002?
>
> Thanks for offering a suggestion it was very welcome however i need to
> emphasize that what i am proposing is sort of "community discussion
> suggestion box". Like a "Python Suggestions" group or something. Where
> any and all suggestions, rants, complaints, ideas, etc, are welcome
> from anyone without fear of reprisals.
>
> However, in order for this to succeed the "elite" must take the time
> to actually read it. Maybe we could have some trusted "proof readers"
> who could sift out the spam and useless stuff and then send a modified
> version to the senate for congressional reviewing. Of course at that
> point the senate can further narrow down the list before sending over
> to the white house. This is the only way (short of sending out
> warnings in the python releases) that you can actually get a feel for
> what Joe and Jane Python programmer are happy with.
>

The Python community are volunteers. Nothing gets done until someone
volunteers to do it. The "suggestion box" is your idea. Why don't you
set it up and report back?
 
Reply With Quote
 
Terry Reedy
Guest
Posts: n/a
 
      01-18-2011
On 1/18/2011 11:27 AM, rantingrick wrote:
> On Jan 18, 6:46 am, Antoine Pitrou<(E-Mail Removed)> wrote:
>
>> Design considerations? Where were they discussed?


I far as I know, nowhere until that post in this thread.

> They were never discussed with the bulk of this community and that is
> part of what i want to change. We have a very small group of folks
> making all the decisions and that is fine. However this small group of
> "privileged" folks needs to gather input from the rest of us
> (peasants) on the value of such changes before making rash decisions.


When proposed features are listed on the tracker, as I think this one
should have been, anyone who registers can comment. Real names are
strongly preferred (and required for elevated tracker and repository
access).

> Currently we have a closed set of intellectual inbreeding that is
> rotting the community gene pool.


Do you actually believe this nonsense, or are you just ranting for effect?

In 2010, 20 people were granted commit access. We have 2 more new and
active people this month. The active subset of these 22 comprise a
substantial fraction of active developers. Without a constant influx of
new people, the Python project would slowly die as people left to do
other things.

One way to demonstrate the needed technical and social skills for commit
access is to participate on the tracker with comments, reviews, and patches.

> We need more diversity in this
> "milkshake" to bring about and foster healthy ideas.


Python leaders already know we need more diversity of knowledge and
skills to target Python at diverse platforms with diverse batteries.
Last summer Guido said that we should be a bit more liberal with commit
access. Right now, Brett Cannon is working under a PSF grant to greatly
improve the developer docs so new developers can more easily get up to
speed. One of the stated goals of moving the repository from svn to hg
(a non-trivial project) is to make it easier for more people to
contribute, with or without 'commit privileges'.

--
Terry Jan Reedy

 
Reply With Quote
 
Grant Edwards
Guest
Posts: n/a
 
      01-18-2011
On 2011-01-18, MRAB <(E-Mail Removed)> wrote:
> On 18/01/2011 19:22, rantingrick wrote:


>> Thanks for offering a suggestion it was very welcome however i need to
>> emphasize that what i am proposing is sort of "community discussion
>> suggestion box". Like a "Python Suggestions" group or something. Where
>> any and all suggestions, rants, complaints, ideas, etc, are welcome
>> from anyone without fear of reprisals.
>>
>> However, in order for this to succeed the "elite" must take the time
>> to actually read it. Maybe we could have some trusted "proof readers"
>> who could sift out the spam and useless stuff and then send a modified
>> version to the senate for congressional reviewing. Of course at that
>> point the senate can further narrow down the list before sending over
>> to the white house. This is the only way (short of sending out
>> warnings in the python releases) that you can actually get a feel for
>> what Joe and Jane Python programmer are happy with.


> The Python community are volunteers. Nothing gets done until someone
> volunteers to do it. The "suggestion box" is your idea. Why don't you
> set it up and report back?


He goes by the name of "ranting rick", and you're suggesting that
instead of talking he rolls up his sleeves and does something.

I suspect you're barking into the wind...

--
Grant Edwards grant.b.edwards Yow! Yes, but will I
at see the EASTER BUNNY in
gmail.com skintight leather at an
IRON MAIDEN concert?
 
Reply With Quote
 
rantingrick
Guest
Posts: n/a
 
      01-18-2011
On Jan 18, 3:05*pm, MRAB <(E-Mail Removed)> wrote:

> The Python community are volunteers. Nothing gets done until someone
> volunteers to do it. The "suggestion box" is your idea. Why don't you
> set it up and report back?


Agreed, i would gladly accept you nominating me as the Suggestion Box
president. However we need to decide where the best place to put the
"suggestion box" will be. Sure i could open a website called
"pythonsuggestionbox.com" however i doubt anybody that *needs* to find
it ever would. Heck i would feel "lucky" if a few trolls dropped by
and asked for the GIL to be removed.

In light of that, the only place --and i would argue the best place--
is the official website with a nice link on the home page although i
don't expect that will happen. In that case c.l.py becomes the winner
by default.

Why? Well imagine you are a new python user. Where would you look for
help after downloading the installer? Of course you might go back to
check out python.org a bit more. The next logical step would be python
help and then c.l.py. So either we add a suggestions area to the
official site OR make this group more accessible to the average user.
If it were my choice, i would just make this group more accessible to
newcomers and be done with it. Much eaiser, much less work, and more
results will be produced.

How can we make c.l.py more accessible you ask? Well a good start
would be for some of the well known "elites" to make a public
announcement. If we could convince Guido to make a speech that would
be wonderful however i know he cannot do everything.

"""
In this statement we must stress that a new age of community has
dawned -- an age of freedom. That all pythoneers are created equal and
in the image of Guido. No, not of his physical image, but of his
vision, his wisdom, and his compassion. That we will admonish those
that wish to belittle the most feeble among us and elevate those who
would carry the torch of community at the very expense of their own
selfless vanity. That we are moving forward as a collective group
united in vision, in spirit, and in solidarity for the future
evolution of Python -- and for the greater good of all programming
languages!
"""

Once we get c.l.py back on track i believe it will take some time but
eventually the masses will return and rejoin our efforts. New users
will mold into he community and we shall all reape the benefits.
Hopefully with enough good will and collaboration we can do great
things and save Python from an untimely demise. However we must act
quickly, because the time is ticking away...

 
Reply With Quote
 
rantingrick
Guest
Posts: n/a
 
      01-18-2011
On Jan 18, 3:07*pm, Terry Reedy <(E-Mail Removed)> wrote:
> On 1/18/2011 11:27 AM, rantingrick wrote:


> When proposed features are listed on the tracker, as I think this one
> should have been, anyone who registers can comment. Real names are
> strongly preferred (and required for elevated tracker and repository
> access).


Agreed. However you cannot expect the ordinary python programmers to
follow the tracker. They are not a political as we. However they do
have a voice and we must listen. How can we call ourselves a community
when there exists no means by which the "real" users can express
themselves?


> > Currently we have a closed set of intellectual inbreeding that is
> > rotting the community gene pool.

>
> Do you actually believe this nonsense, or are you just ranting for effect?


This was a strong statement and it was meant to be strong. On on the
face of it some might take it as an insult to the intelligence of our
leaders -- i can assure you that is not the case! Of course we have
good people at the top, however they are not hearing the voices
screaming from below. They are making decisions in a vacuum. This
cannot produce positive results for very much longer. I fear we have
already begun the downward spiral as a community. We must get a grip
and pull ourselves together before inertia rips us apart at the seams.


> One way to demonstrate the needed technical and social skills for commit
> access is to participate on the tracker with comments, reviews, and patches.


We cannot even discuss the tracker until we fix this abomination
called c.l.py. We need to focus on c.l.py. We need to get it back on
track. And i want everyone to participate even the outright bullies
and predators (if they can tone done the rhetoric and be nice again!).
We as a community are existing in a vacuum. Likewise Python dev is
existing in a vacuum. However both of us are in parallel universes. We
must combine the head with the tail or we have nothing but component
parts. Can a car function without wheels? Can a plane function without
it's wings? No, an we are just component parts idle in some
intellectual factory collecting dust!


> *> We need more diversity in this
>
> > "milkshake" to bring about and foster healthy ideas.

>
> Python leaders already know we need more diversity of knowledge and
> skills to target Python at diverse platforms with diverse batteries.
> Last summer Guido said that we should be a bit more liberal with commit
> access. Right now, Brett Cannon is working under a PSF grant to greatly
> improve the developer docs so new developers can more easily get up to
> speed. One of the stated goals of moving the repository from svn to hg
> (a non-trivial project) is to make it easier for more people to
> contribute, with or without 'commit privileges'.


This is a great advancement! Keep them coming!
 
Reply With Quote
 
Terry Reedy
Guest
Posts: n/a
 
      01-18-2011
On 1/18/2011 6:22 PM, rantingrick wrote:

> This was a strong statement and it was meant to be strong.


However, it was falso.

> We cannot even discuss the tracker until we fix this abomination
> called c.l.py.


I have nothing directly to do with c.l.p and care nothing for it. I read
the gmane.comp.python.general mirror of python-list, which filters out
some of the worse of the input from c.l.p. I mostly focus on getting
real work done on the tracker and repository and am only temporarily
spending this much time here as a diversion.

--
Terry Jan Reedy

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing move constructors and move assignment Andrew Tomazos C++ 2 12-12-2011 01:45 PM
I am trying to move spaces to a weblistbox and when I move them... Eduardo78 ASP .Net Web Controls 0 11-03-2005 06:06 PM
from clipper move to python ads Python 3 09-16-2003 11:43 PM
Re[2]: from clipper move to python ads Python 1 09-16-2003 02:01 PM
Re: from clipper move to python Bob Gailer Python 0 09-15-2003 02:54 PM



Advertisments