--- Raymond Hettinger <[EMAIL PROTECTED]> wrote:
>
> FWIW, I wrote those docs. Suggested improvements
> are
> welcome; however, I think they already meet a
> somewhat
> high standard of quality:
>
I respectfully disagree, and I have suggested
improvements in this thread.
Without even reading
--- Nis Jørgensen <[EMAIL PROTECTED]> wrote:
> Steve Howell skrev:
>
> > def firstIsCapitalized(word):
> > return 'A' <= word[0] <= 'Z'
>
> For someone who is worried about the impact of
> non-ascii identifiers,
> you are makin
--- Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> + The operation of \function{groupby()} is similar
> to the \code{uniq}
> filter
> + in \UNIX{}. [...]
Thanks!
The comparison of groupby() to "uniq" really clicks
with me.
To the extent that others like the Unix command line
analogy for u
--- Paul Rubin <"http://phr.cx"@NOSPAM.invalid> wrote:
> [...]
> Here's yet another example that came up in something
> I was working on:
> you are indexing a book and you want to print a list
> of page numbers
> for pages that refer to George Washington. If
> Washington occurs on
> several conse
--- Roy Smith <[EMAIL PROTECTED]> wrote:
> It's certainly easier to parse ip_address as
> compared to IPAddress.
> Same with snmp_manager vs SNMPManager.
>
Somebody earlier was actually advocating something
called proper_case, in which you can capitalize
certain letters for clarity, like
test
--- Nis Jørgensen <[EMAIL PROTECTED]> wrote:
>
> I disagree that word.istitle is the correct idiom -
> from the naming of
> the function in the original example, I would guess
> "word[0].isupper"
> would do the trick.
>
That would return something like this:
You want to add parens:
wor
--- Stef Mientki <[EMAIL PROTECTED]>
wrote:
> Steve Howell wrote:
> > I've always thought that the best way to introduce
> new
> > programmers to Python is to show them small code
> > examples.
> >
> This is really a nice piece of missing Python.
--- Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Sun, 2007-05-27 at 18:12 -0700, Steve Howell
> wrote:
> > [...] there is no way
> > that "uniquekeys" is a sensible variable [...]
>
> That's because the OP didn't heed the advice from
> the
--- Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> That's not for everyone, so it isn't a loss if
> someone sticks
> with writing plain, clear everyday Python instead of
> an itertool.
>
I know most of the module is fairly advanced, and that
average users can mostly avoid it, but this is a very
--- Stef Mientki <[EMAIL PROTECTED]>
wrote:
> >
> >> It would even be nicer, if everybody could drop
> >> her/his examples
> >> in a standard way, so they would be automatically
> >> incorporated in
> >> something like the wxPython interactive demo.
> >>
> >
> > Can you elaborate?
>
> Well if y
--- Stef Mientki <[EMAIL PROTECTED]> > >
> I don't know MoinMoin,
> but the answer is Yes (although maybe not for your
> ten snippets).
> First of all I think all programmers keep there own
> collection of code snippets,
> which much more valuable then "all the code code
> snippets from everyone"
--- Paul Rubin <"http://phr.cx"@NOSPAM.invalid> wrote:
>
>
> But that is what groupby does, except its notion of
> uniqueness is
> limited to contiguous runs of elements having the
> same key.
It occurred to me that we could also rename the
function uniq(), or unique(), after its Unix
counterpa
--- Raymond Hettinger <[EMAIL PROTECTED]> wrote:
> > > That's not for everyone, so it isn't a loss if
> > > someone sticks
> > > with writing plain, clear everyday Python
> instead of
> > > an itertool.
> >
> > I know most of the module is fairly advanced, and
> that
> > average users can mostly
--- Alex Martelli <[EMAIL PROTECTED]> wrote:
> Steve Howell <[EMAIL PROTECTED]> wrote:
>...
> > for has_chars, frags in itertools.groupby(lines,
> > lambda x: len(x) > 0):
>
> Hmmm, it appears to me that itertools.groupby(lines,
> bool) should do
--- Carsten Haese <[EMAIL PROTECTED]> wrote:
> On Sun, 2007-05-27 at 07:30 +, OKB (not
> okblacke) wrote:
> > Underscores are harder to type than any
> alphanumeric character.
>
> This is a discussion about underscores versus
> capital letters denoting
> the word boundaries in
--- Ramashish Baranwal <[EMAIL PROTECTED]>
wrote:
> Hi,
>
> I am trying to execute some tasks periodically,
> those familiar with
> unix can think of it as equivalent to cron jobs. I
> have tried looking
> around, but couldn't find a way. Would appreciate
> any pointers or
> clues..
>
I'm also
--- vasudevram <[EMAIL PROTECTED]> wrote:
> On May 29, 4:39 pm, Steve Holden
> <[EMAIL PROTECTED]> wrote:
>
> > Alternatively, the user could make use of the
> already-existing "sched"
> > module from the standard library. With a little
> threading that would do
> > the job fine.
>
> Yes. Also,
--- Carsten Haese <[EMAIL PROTECTED]> wrote:
> As an aside, while groupby() will indeed often be
> used in conjunction
> with sorted(), there is a significant class of use
> cases where that's
> not the case: I use groupby to produce grouped
> reports from the results
> of an SQL query. In such ca
--- Ramashish Baranwal <[EMAIL PROTECTED]>
wrote:
> > Are you sure that your SMTP server uses this type
> of authentication?
> > Some SMTP servers use POP3 followed by SMTP to
> authenticate instead.
> >
> > use telnet to verify, this link might help.
> >
> >
>
http://www.computerperformance.co.
On May 29, 2:34 am, Raymond Hettinger
<[EMAIL PROTECTED]> wrote:
> The gauntlet has been thrown down. Any creative
> thinkers
> up to the challenge? Give me cool recipes.
>
I don't make any claims to coolness, but I can say
that I myself would have written the code below with
significantly more
> Raymond Hettinger <[EMAIL PROTECTED]> writes:
> > The gauntlet has been thrown down. Any creative
> thinkers
> > up to the challenge? Give me cool recipes.
>
Twin primes? (Sorry, no code, but there's a good
Python example somewhere that returns an iterator that
keeps doing the sieve, feed it
--- kaens <[EMAIL PROTECTED]> wrote:
>
> Anyhow, I'm looking to expand my understanding of
> python, and I feel
> that one of the best ways to do that is looking at
> other peoples code.
>
A lot of the built-in Python modules are implemented
in pure Python. If you are using any of those so far
Python is my favorite programming language. I've used
it as my primary language for about six years now,
including four years of using it full-time in my day
job. Three months ago I decided to take a position
with a team that does a lot of things very well, but
they don't use Python. We use Ruby
--- Jan Claeys <[EMAIL PROTECTED]> wrote:
> Op Mon, 03 Dec 2007 14:20:52 +1300, schreef greg:
>
> > If you want a really appropriate name for a
> programming language, I'd
> > suggest Babbage. (not for Python, though!)
>
> Konrad Zuse wrote the first high-level programming
> language, so I thin
--- Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Colin J. Williams a écrit :
> > I'm not sure that I like add 3, 5, 7
> >
> > but it would be nice to be able to drop the
> parentheses
> > when no argument is required.
> >
> > Thus: close;
> > could replace close();
>
> This just cou
--- [EMAIL PROTECTED] wrote:
>
> What don't I know that I should know to just
> edit/run, preferably at
> the tap of a function key?
Most good editors let you do these things:
1) Save a file.
2) Run a script from the shell.
3) Turn steps 1 and 2 into a macro.
4) Allow you to map th
--- Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> [EMAIL PROTECTED] a écrit :
> > I'm a java guy used to the effective edit/run
> cycle you get with a
> > good IDE.
> >
> > Today I'm writing my first Python, but can't seem
> to find the way to
> > use Python's inherent edit/run cycle.
> >
>
--- Samuel <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Following the masses I was drawn to RoR's website
> today and I saw the
> following HTML template in one of the screencasts:
>
I know a lot of Rails goodies have been ported to
Python, so you might want to google some variations on
"form_remote_
--- Bruno Desthuilliers >
> > Another aspect of Ruby is that the final
> expression
> > evaluated in a method actually gets returned as
> the
> > result of a method,
>
> Unless there's an explict return before...
>
> > which has further implications on
> > whether "close" is simply evaluated or
--- Richard Jones <[EMAIL PROTECTED]>
wrote:
>
> class A(object):
> def set_a(self, value):
> self._a = value
> a = property(lambda self: self._a, set_a)
>
> Note that this differs from a regular attribute
> because "a" is not deletable
> from instances (the property defines no d
--- Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote:
> On Sat, 08 Dec 2007 16:58:25 -0800, Karthik Gurusamy
> wrote:
>
> > Why are the following accepted even without a
> warning about syntax
> > error?
> > (I would expect the python grammar should catch
> these kind of syntax
> > errors)
> >
--- Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote:
> Steve Howell <[EMAIL PROTECTED]> wrote:
>
> > There are a zillion powerful editors out there.
> I've
> > been productive in EditPlus, MultiEdit, SlickEdit,
> > vim, and emacs, just to throw out a
--- Rick Muller <[EMAIL PROTECTED]> wrote:
> If I want to do this, it seems like I need to keep a
> connection
> between the gui element and the original value in
> the elementtree, so
> I can update it. But I'm having a hard time
> visualizing exactly how
> this works. Can someone help me out he
--- Jeremy C B Nicoll <[EMAIL PROTECTED]> wrote:
> Steve Howell <[EMAIL PROTECTED]> wrote:
>
> >
> > --- Jeremy C B Nicoll <[EMAIL PROTECTED]>
> wrote:
>
> > > What command (in XP) does one need to issue to
> > > syntax check a sa
--- [EMAIL PROTECTED] wrote:
> In a C++ application having a Python interpreter
> embedded, is it
> possible to compile a small Python snippet into
> object code and
> serialize the compiled object code to, for example,
> a database? I am
> exploring the possibility of writing a data driven
> appl
--- caroliina <[EMAIL PROTECTED]> wrote:
>
> i made a list of lists but i cant write it into a
> file. how do i get the
> first string in a sublist?
> --
Try doing this:
print list_of_lists
print list_of_lists[0]
print list_of_lists[0][0]
print list_of_lists[0][0][0]
It might give you some i
After starting this discussion thread, I found the
link below:
http://www.b-list.org/weblog/2006/jun/18/lets-talk-about-python-and-ruby/
If you're like me--struggling to learn Ruby while
having Python as your primary point of reference--you
might find some of the points informative. I suspect
vi
--- MonkeeSage <[EMAIL PROTECTED]> wrote:
>
> Not just callable, but interchangeable. My point was
> that in ruby, if
> you use a block or a lambda as a HOF, you have to
> use #call / #[] /
> yield keyword on it to call it.
>
> def foo(a)
> puts a
> end
> bar = lambda { | a | puts a }
>
> # t
--- CoolGenie <[EMAIL PROTECTED]> wrote:
> self.feed = self.config['feedsrc']
> self.numfeeds = self.config['numfeeds']
> self.numlines = self.config['numlines']
>
> self.w = 520
> self.h = 12*self.numfeeds*(self.numlines+1)
> adesklets.
--- CoolGenie <[EMAIL PROTECTED]> wrote:
> OK, sorry, this was about indents. Stupid VIM!
No prob. Add something like this (untested) to your
~/.vimrc:
set expandtab
set sw=4
set ts=4
Looking for
--- CoolGenie <[EMAIL PROTECTED]> wrote:
> OK, sorry, this was about indents. Stupid VIM!
One more piece of VIM advice. You can use "set list"
to show where tabs are. I prefer to convert my own
tabs to spaces automatically, but you inevitably come
across code that you don't own where it's nice
--- Bruno Desthuilliers
<[EMAIL PROTECTED]> wrote:
> Steve Howell a écrit :
> (snip)
> >
> > Jordan and others, thanks for all your posts; I am
> > learning a lot about both languages.
> >
> > This is what I've gathered so far.
> >
>
--- MonkeeSage <[EMAIL PROTECTED]> wrote:
> On Dec 9, 6:23 pm, MonkeeSage <[EMAIL PROTECTED]>
> wrote:
> > Hi Bruno,
> >
> > I think that we've been having a mainly "semantic"
> (pun intended)
> > dispute. I think you're right, that we've been
> using the same words
> > with different meanings.
>
--- Jan Claeys <[EMAIL PROTECTED]> wrote:
>
> To conclude this discussion:
>
> * in Python, methods are attributes
> * in Ruby, attributes are methods
>
So clearly one of the languages has it all wrong. ;)
___
--- [EMAIL PROTECTED] wrote:
> TCP/IP sounds good but isn't it a bit too heavy?
It depends on your judgment, of course. On a
simplistic level, using TCP/IP shouldn't be any more
work than what you'd do if you were reading and
writing files, especially if everything you're doing
is on the same bo
On May 3, 5:21 pm, Emile van Sebille wrote:
> On 5/3/2009 3:39 PM bearophileh...@lycos.com said...
>
>
>
> > Sometimes I rename recursive functions, or I duplicate&modify them,
> > and they stop working because inside them there's one or more copy of
> > their old name.
> > This happens to me more
On May 3, 3:39 pm, bearophileh...@lycos.com wrote:
> Sometimes I rename recursive functions, or I duplicate&modify them,
> and they stop working because inside them there's one or more copy of
> their old name.
> This happens to me more than one time every year.
> So I have written this:
>
> from i
On May 4, 11:08 pm, Steven D'Aprano
wrote:
>
> I propose a small piece of sugar. When a function is entered, Python
> creates an ordinary local name in the function's local namespace, and
> binds the function itself to that name. Two possibilities for the name
> are `this` or `__this__`, analogous
On May 10, 9:10 am, Rustom Mody wrote:
> I am trying to write a recursive filter to remove whitespace-only
> nodes for minidom.
> The code is below.
>
> Strangely it deletes some whitespace nodes and leaves some.
> If I keep calling it -- like so: fws(fws(fws(doc))) then at some
> stage all the w
On May 10, 10:23 am, rustom wrote:
> On May 10, 9:49 pm, Steve Howell wrote:
>
>
>
> > On May 10, 9:10 am, Rustom Mody wrote:
>
> > > I am trying to write a recursive filter to remove whitespace-only
> > > nodes for minidom.
> > > The code is bel
On May 11, 8:28 pm, forrest yang wrote:
> hi
> i am trying to insert a lot of data into a dict, which may be
> 10,000,000 level.
> after inserting 10 unit, the insert rate become very slow, 50,000/
> s, and the entire time used for this task would be very long,also.
> would anyone know some so
On May 11, 11:04 am, "Tim Arnold" wrote:
> Hi, I have some html files that I want to validate by using an external
> script 'validate'. The html files need a doctype header attached before
> validation. The files are in utf8 encoding. My code:
> ---
> import os,sys
> import codecs,subp
On May 11, 10:16 pm, norseman wrote:
> Tim Arnold wrote:
> > Hi, I have some html files that I want to validate by using an external
> > script 'validate'. The html files need a doctype header attached before
> > validation. The files are in utf8 encoding. My code:
> > ---
> > import o
On May 11, 11:31 pm, norseman wrote:
> Steve Howell wrote:
> > On May 11, 10:16 pm, norseman wrote:
> >> Tim Arnold wrote:
> >>> Hi, I have some html files that I want to validate by using an external
> >>> script 'validate'. The html files ne
See suggested debugging tip inline of your program
On May 11, 11:04 am, "Tim Arnold" wrote:
> Hi, I have some html files that I want to validate by using an external
> script 'validate'. The html files need a doctype header attached before
> validation. The files are in utf8 encoding. My code
On May 12, 8:59 am, wdveloper wrote:
> Hi everyone,
>
> I am trying to call a webservice which requires an http
> authentication.
> To reach the ws, I must pass from a proxy http. So in the whole I need
> go through two authentications before getting the ws working. I am
> using SOAPpy and I'm get
On May 12, 12:51 pm, wdveloper wrote:
> On May 12, 8:38 pm, Steve Howell wrote:
>
>
>
> > On May 12, 8:59 am, wdveloper wrote:
>
> > > Hi everyone,
>
> > > I am trying to call a webservice which requires an http
> > > authentication.
> >
On May 18, 6:19 am, thomas.vo...@likeabird.de wrote:
> On 17 Mai, 04:22, Grant Edwards wrote:
>
> > On 2009-05-17, Thomas Vogel wrote:
>
> > > I'm currently have the problem that I try to read UDP messages from
> > > multiple sockets in parallel. So let's say I get UDP packets from the
> > > same
Python has this really neat idea called indentation-based syntax, and
there are folks that have caught on to this idea in the HTML
community.
AFAIK the most popular indentation-based solution for generating HTML
is a tool called HAML, which actually is written in Ruby.
I have been poking around w
On Nov 27, 9:56 pm, "David Williams" wrote:
> You might want to take a look at this:
>
> http://www.ghrml.org/
>
Yep, it's not clear how actively they are maintaining that. The fact
that it seems to target Genshi only might be limiting their audience,
which is unfortunate.
--
http://mail.pytho
On Nov 28, 6:15 pm, J wrote:
> Ok... so I've been re-teaching myself python, as it's been several
> years since I last really used it. And in the midst of this, my
> contracting company came up to me on Friday and asked if I'd be
> interested in filling a last minute vacancy in this:
>
> http://w
On Nov 29, 4:26 pm, markolopa wrote:
> Less than 3 hours have passed since my last post and got yet another
> bug that could be prevented if Python had the functionality that other
> languages have to destroy variables when a block ends. Here is the
> code:
>
> =
>
> arg_columns = []
> for
On Nov 22, 8:38 pm, Roy Smith wrote:
> In article <4b0a01a...@dnews.tpgi.com.au>, Lie Ryan
> wrote:
>
> > The semantic of the in-place operator is something like:
> > x += y
> > becomes
> > x = x.__iadd__(y)
>
> > thus
> > foo.bar += baz
> > becomes
> > foo.bar = foo.bar.__iadd__(baz)
>
> > So th
On Nov 28, 4:46 am, "Colin W." wrote:
> On 27-Nov-09 22:04 PM, Steve Howell wrote:
>
>
>
> > Python has this really neat idea called indentation-based syntax, and
> > there are folks that have caught on to this idea in the HTML
> > community.
>
&
FYI:
http://twitter.com/gvanrossum
Python is a truly awesome programming language. Not only is Guido a
genius language designer, but he is also a great project leader. What
an accomplishment. Congratulations to everybody who has contributed
to Python in the last two decades!
--
http://mail.p
On Jan 1, 9:03 am, MRAB wrote:
> J Peyret wrote:
> > On Dec 31 2009, 2:06 pm, Steve Howell wrote:
> >> FYI:
>
> >>http://twitter.com/gvanrossum
>
> >> Python is a truly awesome programming language. Not only is Guido a
> >> genius language des
Hi everybody, I would like to announce the latest version of shpaml,
which is an indentation-based markup language similar to haml, but
different.
Shpaml allows you to author HTML-like content with an indentation-
based syntax that eliminates the need to write and read close tags and
angle bracket
On Jan 18, 8:44 am, Jonathan S wrote:
> Hi all,
> The following is what I want to do, but this results in a syntax
> error:
>
> @news_page('template.html').lookup(News, 'news_id', 'news')
> def view(request, group, news):
> pass
>
> What does work is the equivalent old way of doing decorating:
Hi, I have a style/design question relating to recursion and inner
methods.
I wrote some code recently that implements a recursive algorithm that
takes several parameters from the original caller. Once the algorithm
starts running and recursing, those parameters remain the same, so I
define an in
On Jan 18, 6:07 pm, "Gabriel Genellina"
wrote:
> En Mon, 18 Jan 2010 19:00:17 -0300, Steve Howell
> escribió:
>
> > Hi, I have a style/design question relating to recursion and inner
> > methods.
>
> > I wrote some code recently that implements a re
Hi, I'm looking for ideas on building a simple architecture that
allows a bunch of independent Python processes to exchange data using
files and perform calculations.
One Python program would be collecting data from boat instruments on a
serial port, then writing that info out to a file, and also
On Jan 21, 9:03 am, Adam Tauno Williams
wrote:
> On Thu, 2010-01-21 at 08:54 -0800, Steve Howell wrote:
> > Hi, I'm looking for ideas on building a simple architecture that
> > allows a bunch of independent Python processes to exchange data using
> > files and perform ca
On Jan 21, 9:37 am, a...@pythoncraft.com (Aahz) wrote:
> In article
> <0af0eff2-50e2-44aa-81f1-b3d12cb26...@a15g2000yqm.googlegroups.com>,
> Steve Howell wrote:
>
>
>
> >Hi, I'm looking for ideas on building a simple architecture that
> >allows a
The v2.6.4 version of the tutorial says this:
'''
It is also possible to use a list as a queue, where the first element
added is the first element retrieved (“first-in, first-out”); however,
lists are not efficient for this purpose. While appends and pops from
the end of list are fast, doing inser
On Jan 22, 11:29 am, Martin Drautzburg
wrote:
> This has probably been asekd a million times, but if someone could give
> a short answer anyways I's be most grateful.
Not sure there is exactly a short answer, and I am only qualified to
maybe clarify some of the things you can and cannot do, not e
On Jan 22, 12:14 pm, Chris Rebert wrote:
> On Fri, Jan 22, 2010 at 11:14 AM, Steve Howell wrote:
> > The v2.6.4 version of the tutorial says this:
>
> > '''
> > It is also possible to use a list as a queue, where the first element
> > added is the
On Jan 22, 12:40 pm, Christian Heimes wrote:
> Steve Howell wrote:
> > Is that really true in CPython? It seems like you could advance the
> > pointer instead of shifting all the elements. It would create some
> > nuances with respect to reclaiming the memory, but it seems
On Jan 22, 1:08 pm, Arnaud Delobelle wrote:
> Steve Howell writes:
> > On Jan 22, 12:14 pm, Chris Rebert wrote:
> >> On Fri, Jan 22, 2010 at 11:14 AM, Steve Howell wrote:
> >> > The v2.6.4 version of the tutorial says this:
>
> >> > '
On Jan 22, 1:29 pm, Christian Heimes wrote:
> Steve Howell wrote:
> > I disagree that Python code rarely pops elements off the top of a
> > list. There are perfectly valid use cases for wanting a list over a
> > dequeue without having to pay O(N) for pop(0). Maybe we are ju
On Jan 22, 1:32 pm, Terry Reedy wrote:
> On 1/22/2010 2:14 PM, Steve Howell wrote:
>
> > The v2.6.4 version of the tutorial says this:
> > Is that really true in CPython? It seems like you could advance the
> > pointer instead of shifting all the elements. It would crea
On Jan 22, 2:54 pm, Dave Angel wrote:
> Steve Howell wrote:
> > On Jan 22, 12:40 pm, Christian Heimes wrote:
>
> >> Steve Howell wrote:
>
> >>> Is that really true in CPython? It seems like you could advance the
> >>> pointer instead of
On Jan 22, 3:17 pm, Christian Heimes wrote:
> Steve Howell wrote:
> > That maybe would be an argument for just striking the paragraph from
> > the tutorial. If it's rare that people pop the head off the list in
> > code that is performance critical or prominent, why bot
I just saw the thread for medians, and it reminded me of a problem
that I need to solve. We are writing some Python software for
sailing, and we need to detect when we've departed from the median
heading on the leg. Calculating arithmetic medians is
straightforward, but compass bearings add a twi
On Jan 22, 6:20 pm, Steven D'Aprano wrote:
> On Fri, 22 Jan 2010 14:38:18 -0800, Steve Howell wrote:
> > I know the Python programmer could simply iterate through the list
> > rather than popping off unused elements, but that just means that you
> > not only tie up t
On Jan 22, 7:09 pm, Roy Smith wrote:
> In article
> <3ac173bd-4124-434d-b726-0b9baaeec...@36g2000yqu.googlegroups.com>,
> Steve Howell wrote:
>
> > In my case I'm not really concerned about giving the memory back right
> > away, it's more about keepin
On Jan 22, 5:12 pm, MRAB wrote:
> Steve Howell wrote:
> > I just saw the thread for medians, and it reminded me of a problem
> > that I need to solve. We are writing some Python software for
> > sailing, and we need to detect when we've departed from the med
On Jan 22, 10:29 pm, Nobody wrote:
> On Fri, 22 Jan 2010 16:09:03 -0800, Steve Howell wrote:
> > I just saw the thread for medians, and it reminded me of a problem
> > that I need to solve. We are writing some Python software for
> > sailing, and we need to detect when we
On Jan 22, 11:10 pm, a...@pythoncraft.com (Aahz) wrote:
>
> >I know Python's number one concern will never be speed, but if Python
> >makes an O(1) operation into an unnecessarily O(N) operation for no
> >good reasons other than "it's too complicated, " or it "adds another
> >pointer to the structu
On Jan 22, 11:10 pm, a...@pythoncraft.com (Aahz) wrote:
> In article <83082e19-9130-45a8-91f2-8601c1fda...@22g2000yqr.googlegroups.com>,
> Steve Howell wrote:
>
>
>
>
>
> >I really want to use list *normally* with all its perfectly good
> >semantics and re
On Jan 23, 12:13 am, Terry Reedy wrote:
>
> Challenge yes, mock no.
>
> Part of writing good basic data structures is not adding needless
> complication from featuritis and not penalizing 99.99% of access to
> satify a .01% need better satisfied another way.
>
I would like to challenge your asser
On Jan 23, 12:32 am, "Alf P. Steinbach" wrote:
> * Steve Howell:
>
> > On Jan 23, 12:13 am, Terry Reedy wrote:
> >> Challenge yes, mock no.
>
> >> Part of writing good basic data structures is not adding needless
> >> complication fr
On Jan 23, 12:13 am, Terry Reedy wrote:
> On 1/23/2010 12:58 AM, Steve Howell wrote:
>
> > I really want to use list *normally* with all its perfectly good
> > semantics and reasonable implementation, except for its blind spot
> > with respect to popping the first element
On Jan 23, 1:24 am, Terry Reedy wrote:
> On 1/23/2010 3:23 AM, Steve Howell wrote:
>
> > On Jan 23, 12:13 am, Terry Reedy wrote:
>
> >> Challenge yes, mock no.
>
> >> Part of writing good basic data structures is not adding needless
> >> complication
On Jan 23, 5:46 am, Christian Heimes wrote:
> Steve Howell wrote:
> > Another benchmark is that deques are slower than lists for accessing
> > elements.
>
> deques are optimized for accessing, inserting and removing data from
> both ends. For anything else it's slower
On Jan 23, 6:40 am, Roy Smith wrote:
> In article
> ,
> Steve Howell wrote:
>
> > This innocent program here literally moves about a million bytes of
> > memory around for no good reason:
>
> > lst = []
> > for i in range(2000):
>
On Jan 23, 4:12 am, Steven D'Aprano wrote:
>
>
> An alternative would be to do exactly what you want lists to do: track
> the start of the list. Untested:
>
> def recurse(prefix_lines):
> start = 0
> end = len(prefix_lines)
> while start < end:
> prefix, lin
On Jan 23, 4:12 am, Steven D'Aprano wrote:
> On Fri, 22 Jan 2010 21:42:43 -0800, Steve Howell wrote:
> > This innocent program here literally moves about a million bytes of
> > memory around for no good reason:
>
> > lst = []
> > for i in ra
On Jan 23, 7:54 am, Steven D'Aprano wrote:
> On Sat, 23 Jan 2010 09:57:04 -0500, Roy Smith wrote:
> > In article ,
> > "Alf P. Steinbach" wrote:
>
> >> But it would IMHO have been better if it wasn't called "list", which
> >> brings in the wrong associations for someone used to other languages.
On Jan 23, 8:00 pm, Raymond Hettinger wrote:
> [Steve Howell]
>
> > Why wouldn't you get a competent C programmer simply make
> > list_ass_slice smart enough to make list.pop(0) O(1)?
>
> When this suggestion was discussed on python-dev years ago,
> it was reje
On Jan 24, 3:20 am, Steven D'Aprano wrote:
> On Sun, 24 Jan 2010 02:33:36 -0800, Steve Howell wrote:
> > You are also a brilliant computer scientist, despite the fact that you
> > are defending a list implemenation that can't pop the first element off
> > the list
201 - 300 of 452 matches
Mail list logo