MRAB wrote:
>
>I'd just like to point out that it's a convention, not a rigid rule.
Reminds me of the catch-phrase from the first Pirates of the Caribbean
movie: "It's more of a guideline than a rule."
--
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.
--
http://mail.python.org/mailm
On Fri, May 27, 2011 at 12:08 PM, Roy Smith wrote:
> Sometimes
> I'll drop in suggestions to future maintainers like, "consider
> refactoring with with perform_frobnitz_action()"
Usually, I address future-me with comments like that (on the
assumption that there's nobody in the world sadistic eno
Roy Smith, 27.05.2011 03:13:
Ethan Furman wrote:
--> 'this is a test'.startswith('this')
True
--> 'this is a test'.startswith('this', None, None)
Traceback (most recent call last):
File "", line 1, in
TypeError: slice indices must be integers or None or have an __index__
method
[...]
On Fri, May 27, 2011 at 1:52 PM, Steven D'Aprano
wrote:
> Because "lst" is not a real word. To native readers of languages derived
> from Latin or Germany, such as English, it is quite a strange "word"
> because it has no vowel. In addition, it looks like 1st (first).
Contrived examples are alway
On Fri, 27 May 2011 13:24:24 +1000, Chris Angelico wrote:
> On Fri, May 27, 2011 at 11:59 AM, Steven D'Aprano
> wrote:
>> def get(list, object):
>> """Append object to a copy of list and return it.""" return list +
>> [object]
>>
>> For one or two line functions, I think that's perfectly re
John Bokma wrote:
A Perl programmer will call this line noise:
double_word_re = re.compile(r"\b(?P\w+)\s+(?P=word)(?!\w)",
re.IGNORECASE)
for match in double_word_re.finditer(text):
print ("{0} is duplicated".format(match.group("word"))
Actually, Python program
On Thu, 26 May 2011 23:00:32 -0400, Terry Reedy wrote:
[...]
> To me, that says pretty clearly that start and end have to be
> 'positions', ie, ints or other index types. So I would say that the
> error message is a bug. I see so reason why one would want to use None
> rather that 0 for start or
On Fri, May 27, 2011 at 11:59 AM, Steven D'Aprano
wrote:
> def get(list, object):
> """Append object to a copy of list and return it."""
> return list + [object]
>
> For one or two line functions, I think that's perfectly reasonable.
> Anything more than that, I'd be getting nervous.
But ev
On Thu, 26 May 2011 16:03:58 -0400, Terry Reedy wrote:
> On 5/26/2011 11:36 AM, John Bokma wrote:
>> Ben Finney writes:
>
> [impolite comment not quoted]
Get a life. Or better, just fuck off and die. It will improve both
the world and the Python community, of which you are nothin
On 5/26/2011 7:27 PM, Ethan Furman wrote:
I've tried this in 2.5 - 3.2:
--> 'this is a test'.startswith('this')
True
--> 'this is a test'.startswith('this', None, None)
Traceback (most recent call last):
File "", line 1, in
TypeError: slice indices must be integers or None or have an __index__
In article ,
Chris Angelico wrote:
> Still trying to sort this out, trying various things. If I configure
> --enable-shared, I get a different ImportError: 'libpython3.3m.so.1.0:
> cannot open shared object file: No such file or directory'. That file
> exists in ~/cpython, but sudo make install d
In article ,
Richard Parker wrote:
> On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote:
>
> > My experience is that comments in Python are of relatively low
> > usefulness. (For avoidance of doubt: not *zero* usefulness, merely low.)
> > I can name variables, functions and cla
On Thu, 26 May 2011 11:27:35 -0700, John Ladasky wrote:
> On May 25, 9:46 pm, Uncle Ben wrote:
>
>> list = [1,2,3]
>
> Somewhat unrelated, but... is it a good idea to name your list "list"?
> Isn't that the name of Python's built-in list constructor method?
>
> Shadowing a built-in has contri
Richard Parker writes:
> On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote:
>
> > My experience is that comments in Python are of relatively low
> > usefulness. (For avoidance of doubt: not *zero* usefulness, merely
> > low.) I can name variables, functions and classes with sensib
Raymond Hettinger writes:
> I just posted a tutorial and how-to guide for making effective use of
> super().
Thanks very much! We need articles like this.
Raymond Hettinger writes:
> Here's a link to the super() how-to-guide and commentary: bit.ly/
> iFm8g3
We also, though, need *real* URLs
In article ,
Ethan Furman wrote:
> --> 'this is a test'.startswith('this')
> True
> --> 'this is a test'.startswith('this', None, None)
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: slice indices must be integers or None or have an __index__
> method
[...]
> Any re
Ethan Furman wrote:
> I've tried this in 2.5 - 3.2:
>
> --> 'this is a test'.startswith('this')
> True
> --> 'this is a test'.startswith('this', None, None)
> Traceback (most recent call last):
>File "", line 1, in
> TypeError: slice indices must be integers or None or have an __index__
> me
On Thursday, May 26, 2011 4:27:22 PM UTC-7, MRAB wrote:
> On 27/05/2011 00:27, Ethan Furman wrote:
> > I've tried this in 2.5 - 3.2:
> >
> > --> 'this is a test'.startswith('this')
> > True
> > --> 'this is a test'.startswith('this', None, None)
> > Traceback (most recent call last):
> > File "", l
Still trying to sort this out, trying various things. If I configure
--enable-shared, I get a different ImportError: 'libpython3.3m.so.1.0:
cannot open shared object file: No such file or directory'. That file
exists in ~/cpython, but sudo make install doesn't put it anywhere
else. Pointing LD_LIBR
On May 26, 5:33 pm, Daniel Kluev wrote:
> On Wed, May 25, 2011 at 3:10 AM, Octavian Rasnita wrote:
> >> Once again. Suppose we have array of key-value pairs (two-dimensional
> >> array),
>
> > This is a forced example to fit the way Python can do it with a clean
> > syntax, but I don't think the
* sal migondis (Thu, 26 May 2011 17:50:32 -0400)
> On Thu, May 26, 2011 at 12:28 PM, sal migondis
> wrote:
> > From: Thorsten Kampe
> > It's unnecessary bullshit buzzword bingo from nerds which adds or
> > helps or explains nothing. It's just that simple.
>
> This has nothing to do with buzzword
On 27/05/2011 00:27, Ethan Furman wrote:
I've tried this in 2.5 - 3.2:
--> 'this is a test'.startswith('this')
True
--> 'this is a test'.startswith('this', None, None)
Traceback (most recent call last):
File "", line 1, in
TypeError: slice indices must be integers or None or have an __index__
m
I've tried this in 2.5 - 3.2:
--> 'this is a test'.startswith('this')
True
--> 'this is a test'.startswith('this', None, None)
Traceback (most recent call last):
File "", line 1, in
TypeError: slice indices must be integers or None or have an __index__
method
The 3.2 docs say this:
str.sta
On May 26, 4:20 am, Thorsten Kampe wrote:
> Did your mom tell you to "recursively clean up your room"?.
that had me L O L!
i think i'll quote in my unix hating blogs sometimes, if you don't
mind. ☺
Xah
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, May 26, 2011 at 12:28 PM, sal migondis wrote:
> From: Thorsten Kampe
> Subject: Re: English Idiom in Unix: Directory Recursively
> Date: Thu, 26 May 2011 12:46:58 +0200
> To: python-list@python.org
>
> * Steven D'Aprano (26 May 2011 10:06:44 GMT)
>>
>> On Thu, 26 May 2011 10:48:07 +0200,
On 5/26/2011 11:58 AM, MRAB wrote:
On 26/05/2011 06:17, Chris Rebert wrote:
list.remove(), list.sort(), and list.extend() similarly return None
rather than the now-modified list.
I'd just like to point out that it's a convention, not a rigid rule.
Sometimes it's not followed, for example, dic
On Wed, May 25, 2011 at 3:10 AM, Octavian Rasnita wrote:
>> Once again. Suppose we have array of key-value pairs (two-dimensional
>> array),
>
> This is a forced example to fit the way Python can do it with a clean syntax,
> but I don't think there are cases in which somebody wants to create
> h
- Original Message -
From: "Richard Parker"
To:
Sent: Thursday, May 26, 2011 11:50 AM
Subject: The worth of comments
On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote:
My experience is that comments in Python are of relatively low
usefulness. (For avoidance of dou
On 05/26/2011 10:03 PM, Terry Reedy wrote:
On 5/26/2011 11:36 AM, John Bokma wrote:
Ben Finney writes:
[impolite comment not quoted]
Get a life. Or better, just fuck off and die. It will improve both the
world and the Python community, of which you are nothing but a little,
smelly shits
On 5/26/2011 2:13 PM, Dotan Cohen wrote:
On Thu, May 26, 2011 at 19:39, Raymond Hettinger wrote:
It would also be great if some of you would upvote it on HackerNews.
Here's a link to the super() how-to-guide and commentary: bit.ly/
iFm8g3
Is that the same link as in the OP? I don't click
On 5/26/2011 11:36 AM, John Bokma wrote:
Ben Finney writes:
[impolite comment not quoted]
Get a life. Or better, just fuck off and die. It will improve both the
world and the Python community, of which you are nothing but a little,
smelly shitstain.
That abuse is entirely unwelcome in
>> And why do you insist on calling an instance of list, "list"? Even a
>> human reader will confuse which is which. What you are showing is an
>> example how confusing things become when a keyword (list) is
>> over-written (with list instance).
> (Minor note: 'list' is not a keyword (if it were,
hello, I am using this code to send data over https with post method:
params='tieto data idu na sevrer\n'
kamodoslat = "https://domena.tld/script.php";
req = urllib2.Request(kamodoslat)
req.add_header('User-Agent', 'agent')
resp = urllib2.urlopen(req, params)
how can I make sure that data were re
On Thu, May 26, 2011 at 21:38, Ian Kelly wrote:
> It's a link to ycombinator:
>
> http://news.ycombinator.com/item?id=2588262
>
Thanks.
--
Dotan Cohen
http://gibberish.co.il
http://what-is-what.com
--
http://mail.python.org/mailman/listinfo/python-list
On May 26, 2011, at 4:28 AM, python-list-requ...@python.org wrote:
> My experience is that comments in Python are of relatively low
> usefulness. (For avoidance of doubt: not *zero* usefulness, merely low.)
> I can name variables, functions and classes with sensible, self-
> documenting names. W
On 5/26/2011 3:18 AM, Algis Kabaila wrote:
And why do you insist on calling an instance of list, "list"? Even a
human reader will confuse which is which. What you are showing is an
example how confusing things become when a keyword (list) is
over-written (with list instance).
(Minor note: 'lis
On Thu, May 26, 2011 at 12:13 PM, Dotan Cohen wrote:
> On Thu, May 26, 2011 at 19:39, Raymond Hettinger wrote:
>>> It would also be great if some of you would upvote it on HackerNews.
>>
>>
>> Here's a link to the super() how-to-guide and commentary: bit.ly/
>> iFm8g3
>>
>
> Is that the same lin
On May 25, 9:46 pm, Uncle Ben wrote:
> list = [1,2,3]
Somewhat unrelated, but... is it a good idea to name your list
"list"? Isn't that the name of Python's built-in list constructor
method?
Shadowing a built-in has contributed to more than one subtle bug in my
code, and I've learned to avoid
On Thu, May 26, 2011 at 19:39, Raymond Hettinger wrote:
>> It would also be great if some of you would upvote it on HackerNews.
>
>
> Here's a link to the super() how-to-guide and commentary: bit.ly/
> iFm8g3
>
Is that the same link as in the OP? I don't click on blind links, so
if it isn't then
On Wed, 25 May 2011 10:18:48 +0200, Tracubik wrote:
> Hi all,
> i'm trying to write a simple windows with two button in GTK, i need a
> way to identify wich button is pressed. Consider that:
>
> the two button are connected (when clicked) to infoButton(self, widget,
> data=None)
>
> infoButton()
> It would also be great if some of you would upvote it on HackerNews.
Here's a link to the super() how-to-guide and commentary: bit.ly/
iFm8g3
Raymod
--
http://mail.python.org/mailman/listinfo/python-list
I just posted a tutorial and how-to guide for making effective use of
super().
One of the reviewers, David Beazley, said, "Wow, that's really
great!I see this becoming the definitive post on the subject"
The direct link is:
http://rhettinger.wordpress.com/2011/05/26/super-considered-super
On 5/25/2011 6:08 PM, Philip Semanchuk wrote:
On May 25, 2011, at 2:17 PM, Jayme Proni Filho wrote:
Helo guys,
I'm building a local application for twitter for my brother's store. I'm in
the beginning and I have some newbie problems, so:
I create a table called tb_messages with int auto incr
John,
You say English is not your first language. Let me assure you that the
words you chose to use in reply to Stephen were vulgar as well as rude,
and did more to lesson the overall friendliness of this forum than
Stephen's adversarial style.
You usually have interesting and informative p
On Fri, May 27, 2011 at 1:58 AM, MRAB wrote:
> I'd just like to point out that it's a convention, not a rigid rule.
> Sometimes it's not followed, for example, dict.setdefault.
dict.setdefault is more like dict.get but it also stores the result.
It's probably more a name issue than a protocol iss
On 26/05/2011 06:17, Chris Rebert wrote:
On Wed, May 25, 2011 at 9:46 PM, Uncle Ben wrote:
In playing with lists of lists, I found the following:
(In 3.1, but the same happens also in 2.7)
list = [1,2,3]
list.append ( [4,5,6] )
Note the lack of output after this line. This indicates that
li
So when quora.com fails we can all say it is Python's fault?
Maybe they should have focused more on content instead of
the bits under the hood?
--
http://mail.python.org/mailman/listinfo/python-list
Ben Finney writes:
>> Get a life. Or better, just fuck off and die. It will improve both the
>> world and the Python community, of which you are nothing but a little,
>> smelly shitstain.
>
> That abuse is entirely unwelcome in this community, against any person.
> Please desist.
You should have
On 5/25/2011 7:52 PM, Steven D'Aprano wrote:
On Wed, 25 May 2011 17:30:48 -0400, theg...@nospam.net wrote:
On 5/24/2011 1:39 PM, D'Arcy J.M. Cain wrote: [snip]
One of my favorite quotes (not sure if it was about Perl or APL) is "I
refuse to use a programming language where the proponents of it
Am 20.05.2011 19:56, schrieb Andrew Berg:
This is probably somewhat off-topic, but where would I find a list of
what each error code in WindowsError means? WindowsError is so broad
that it could be difficult to decide what to do in an except clause.
Fortunately, sys.exc_info()[1][0] holds the spe
On Thu, 26 May 2011 12:44:47 +, Neil Cerutti wrote:
> On 2011-05-25, Matty Sarro wrote:
>> General readability is a farce. If it was true we would only have one
>> section to the library. Different people enjoy reading, and can
>> comprehend better in different ways. THat's why some people ar
Roy Smith writes:
> Also, the purpose of source code is to transmit information (to both
> the compiler and to human readers).
And the relative importance of readability for those two purposes is
often misunderstood.
Composing source code so that the *machine* will understand it is one
thing, a
In article <94709uf99...@mid.individual.net>,
Neil Cerutti wrote:
> On 2011-05-25, Matty Sarro wrote:
> > General readability is a farce. If it was true we would only
> > have one section to the library. Different people enjoy
> > reading, and can comprehend better in different ways. THat's
> >
On 2011-05-25, Matty Sarro wrote:
> General readability is a farce. If it was true we would only
> have one section to the library. Different people enjoy
> reading, and can comprehend better in different ways. THat's
> why some people are super verbose - hell, just look at this
> here post! :)
D
Hello list,
I am installing and testing istSOS wrote base on Python with its extension like
gdal, isodate, easy istall, setuptool, psycopg. I have already installed all
these stuff when I was using method POST the error appear is "No module named
mx.DateTime.ISO" , could you please give me your
On Thu, May 26, 2011 at 9:20 PM, Thorsten Kampe
wrote:
> Did your mom tell you to "recursively clean up your room"?.
>
Considering that I don't have a wardrobe with a portal to Narnia, no,
she has never had to tell me to clean up the room inside my room.
Anyway, my room's full. There's no room i
* Charles (Thu, 26 May 2011 20:58:35 +1000)
> "Thorsten Kampe" wrote in message
> news:mpg.284834d227e3acd1989...@news.individual.de...
> >
> > If someone has learned what a directory or folder is, you don't have
> > to explain what "include sub-folders" means. Instead of creating a
> > new myste
I just conducted a rapid poll of a non-technical userbase.
(Okay, I just asked my sister who happens to be sitting here. But
she's nontechnical.)
She explained "recursive" as "it repeats until it can't go any
further". I think that's a fair, if not perfectly accurate,
explanation.
Actually... if
"Thorsten Kampe" wrote in message
news:mpg.284834d227e3acd1989...@news.individual.de...
>
> If someone has learned what a directory or folder is, you don't have to
> explain what "include sub-folders" means. Instead of creating a new
> mysterious term ("recursively delete"), you simply explain s
* Steven D'Aprano (26 May 2011 10:06:44 GMT)
>
> On Thu, 26 May 2011 10:48:07 +0200, Thorsten Kampe wrote:
>
> > But not to digress, the /real/ problem with commands or idioms like "rm
> > -r" is /not/ their choice of option names but that they explain these
> > options in the exact same terms. N
[This edition drafted by Gabriel Genellina.]
QOTW: "They did a study once to determine the best tool for
development. Turns
out that the most productive tool was generally the one that the user
believed was
the most productive. In hindsight I think that that was rather
obvious." - D'Arcy
J.M. C
On Thu, May 26, 2011 at 8:07 PM, Steven D'Aprano
wrote:
> Another use for comments is to explain *why* rather than *what*. No
> matter how readable your code is, if you don't understand why it is done,
> you can't effectively maintain it. If the why is obvious, you don't need
> a comment.
That's
On Thu, 26 May 2011 14:06:56 +1000, Chris Angelico wrote:
> On Thu, May 26, 2011 at 10:58 AM, Richard Parker
> wrote:
>> It's time to stop having flame wars about languages and embrace
>> programmers who care enough about possible future readers of their code
>> to thoroughly comment it. Comments
On Thu, 26 May 2011 10:48:07 +0200, Thorsten Kampe wrote:
> But not to digress, the /real/ problem with commands or idioms like "rm
> -r" is /not/ their choice of option names but that they explain these
> options in the exact same terms. No one would have a problem with "-r,
> --recursive -- remo
* Steven D'Aprano (25 May 2011 22:58:21 GMT)
>
> On Wed, 25 May 2011 00:06:06 +0200, Rikishi42 wrote:
>
> > What I mean is: I'm certain that over the years I've had more than
one
> > person come to me and ask what 'Do you wish to delete this directory
> > recursively?' meant. BAut never have I b
* Steven D'Aprano (25 May 2011 21:59:58 GMT)
> On Wed, 25 May 2011 09:26:11 +0200, Thorsten Kampe wrote:
>
> > Naming something in the terms of its implementation details (in this
> > case recursion) is a classical WTF.
>
> *If* that's true, it certainly doesn't seem to apply to real-world
> obj
* John Bokma (Wed, 25 May 2011 07:01:07 -0500)
> Thorsten Kampe writes:
> > * Chris Angelico (Wed, 25 May 2011 08:01:38 +1000)
> >>
> >> On Wed, May 25, 2011 at 3:39 AM, D'Arcy J.M. Cain wrote:
> >> > One of my favorite quotes (not sure if it was about Perl or APL) is
> > "I
> >> > refuse to us
On Thu, May 26, 2011 at 12:23 AM, Chris Angelico wrote:
> On Thu, May 26, 2011 at 5:20 PM, Chris Angelico wrote:
>>
>> Ben Finney has already answered the main question
>
> Giving credit where credit's due, it was more Chris Rebert's post that
> answered the question. Sorry Chris!
Eh, one can't
On Wed, May 25, 2011 at 2:20 PM, Gabriel Genellina
wrote:
> En Sun, 22 May 2011 10:42:08 -0300, Selvam
> escribió:
>
>
> I am using hotshot module to profile my python function.
>>
>> I used the details from (
>>
>> http://code.activestate.com/recipes/576656-quick-python-profiling-with-hotshot/
On May 26, 12:46 am, Uncle Ben wrote:
> In playing with lists of lists, I found the following:
>
> (In 3.1, but the same happens also in 2.7)
>
> list = [1,2,3]
> list.append ( [4,5,6] )
> x = list
> x ->
> [1,2,3,[4,5,6]]
> as expected.
>
> But the shortcut fails:
>
> list=[1,2,3]
> x = lis
On Thu, May 26, 2011 at 5:20 PM, Chris Angelico wrote:
>
> Ben Finney has already answered the main question
Giving credit where credit's due, it was more Chris Rebert's post that
answered the question. Sorry Chris!
Chris Angelico
--
http://mail.python.org/mailman/listinfo/python-list
On Thu, May 26, 2011 at 2:46 PM, Uncle Ben wrote:
> In playing with lists of lists, I found the following:
>
> (In 3.1, but the same happens also in 2.7)
>
> list = [1,2,3]
Ben Finney has already answered the main question, but as a side
point, I would generally avoid creating a variable called '
On Thursday 26 May 2011 14:46:45 Uncle Ben wrote:
> In playing with lists of lists, I found the following:
>
> (In 3.1, but the same happens also in 2.7)
>
> list = [1,2,3]
> list.append ( [4,5,6] )
> x = list
> x ->
> [1,2,3,[4,5,6]]
> as expected.
>
> But the shortcut fails:
>
> list=[1
73 matches
Mail list logo