move to end, in Python 3.2 Really?

N

nn

I somehow missed this before. I like most of the additions from
Raymond Hettinger. But the api on this baffles me a bit:
'bacde'

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

rantingrick

I somehow missed this before. I like most of the additions from
Raymond Hettinger. But the api on this baffles me a bit:


If we are not careful with all these "additions" we could end up with
a language like ruby which has wasteful methods to clean your
backside, and take out your trash -- clogging up your dir requests :mad:
Multiplicity is a slippery slope my friend!
 
C

Carl Banks

I somehow missed this before. I like most of the additions from
Raymond Hettinger. But the api on this baffles me a bit:


'bacde'

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

It's a minor issue, but I'd tend to lean that way. Most other times
when something can happen on one end of a sequence or another, it uses
different function calls. E.g.: startswith vs endswith, lstrip vs
rstrip, and even pop vs popleft.

Oddly, Hettinger seems to be a big advocate of not overloading
functions.


Carl Banks
 
R

Raymond Hettinger

...But the api on this baffles me a bit:


'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():
('d', None)

The existing list.pop() API is similar (though it takes an index
value instead of a boolean):

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


Raymond
 
A

Antoine Pitrou

...But the api on this baffles me a bit:


'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():

Well I have to agree that moving to the beginning using move_to_end()
with a "last" argument looks completely bizarre and unexpected.
"Parallels popitem()" is not really convincing since popitem() doesn't
have "end" its name.
Those were the design considerations. Sorry you didn't like the
result.

Design considerations? Where were they discussed?

Regards

Antoine.
 
R

rantingrick

Design considerations? Where were they discussed?


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.

Currently we have a closed set of intellectual inbreeding that is
rotting the community gene pool. We need more diversity in this
"milkshake" to bring about and foster healthy ideas. No wonder we get
these "brain childs" (farts) with inherited diseases from birth.
 
M

MRAB

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.

Currently we have a closed set of intellectual inbreeding that is
rotting the community gene pool. We need more diversity in this
"milkshake" to bring about and foster healthy ideas. No wonder we get
these "brain childs" (farts) with inherited diseases from birth.

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...
 
R

rantingrick

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.
 
R

rantingrick

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

Thanks for this link Antoine however i think you missed the point of
my post. 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. Currently
such a place is non-existent. I believe many folks would get involved
if this "place" existed however it does not exist. I also believe that
these same folks have no interest in "debating" in the highly
competitive environmental of python-dev, python-ideas. Heck, even
c.l.py is far too competitive! They just basically want a forum were
they can come in and give their two cents and leave.

comp.lang.py would be a good place for this to happen since "after
all" Usenet was created for like-minded people to collaborate in
lively discussion. However c.l.py has a problem with criminals. We
need to bring these "predators", "bullies", and "brow beaters" under
control. I have seen many new voices come in and then get crucified by
these scoundrels causing them to quickly "tuck tail" and run for cover
--never to return again-- and nobody says a word!!!! And anyone who
dares to speak out is threatened with the kill-file. This group has
been handed over to the criminals who's only concern is chaos and
anarchy all the while making sure that they control the speech and
content herein.

Now don't get me wrong we have a lot of good people here but they are
too fearful to speak up. Sadly these folks don't realize that by
staying quiet they only embolden the criminals to do more dastardly
deeds. These criminals are cowards by nature, and when presented with
a united front they will themselves "tuck tail" and run for the hills
never to return.

I am not saying we cannot have lively discussion, or even use the
occasional sarcastic quip. No, what i am saying is that we need hear
all sides of the argument. Remember this is a community of many
different people wanting many different things. We must be willing to
first listen, and then compromise on all sides -- if we want to move
forward.

Ask not...

What is best for me?

Instead ask yourself...

What is best for the entire community?


So the moral is... either we need to take back c.l.py (by force if
needed!) or we need to abandon c.l.py and open a more friendly
environment for Python discussions. Either way if this "forum" is not
taken seriously by the "elite" then it will be yet another
catastrophic failure!
 
N

nn

...But the api on this baffles me a bit:

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():

('d', None)

The existing list.pop() API is similar (though it takes an index
value instead of a boolean):

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...
 
E

Emile van Sebille

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.[/QUOTE]


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
 
A

Antoine Pitrou

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.
 
R

rantingrick

On 1/18/2011 9:10 AM rantingrick said...














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? :D

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.
 
M

MRAB

That is dated 2002? :D

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?
 
T

Terry Reedy

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'.
 
G

Grant Edwards

On 18/01/2011 19:22, rantingrick 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?

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...
 
R

rantingrick

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...
 
R

rantingrick

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?

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


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!
 
T

Terry Reedy

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top