On Sat, Jun 22, 2013 at 11:23 PM, Steven D'Aprano
wrote:
> On Sat, 22 Jun 2013 22:27:10 -0600, Ian Kelly wrote:
>> I actually consider that an up side. Sure it's inconvenient that you
>> can't delegate all such methods at once just by overriding
>> __getattribute__, but it would be more troubleso
On Sat, 22 Jun 2013 22:27:10 -0600, Ian Kelly wrote:
> On Sat, Jun 22, 2013 at 9:20 PM, Steven D'Aprano
> wrote:
>> * on the down side, automatic delegation of special double-underscore
>> methods like __getitem__ and __str__ doesn't work with new-style
>> classes.
>
> I actually consider that a
On Sat, Jun 22, 2013 at 9:20 PM, Steven D'Aprano
wrote:
> * on the down side, automatic delegation of special double-underscore
> methods like __getitem__ and __str__ doesn't work with new-style classes.
I actually consider that an up side. Sure it's inconvenient that you
can't delegate all such
On Sun, Jun 23, 2013 at 12:58 PM, Steven D'Aprano
wrote:
> On Sun, 23 Jun 2013 02:20:56 +0100, MRAB wrote:
>
>> One vs not-one isn't good enough. Some languages use the singular with
>> any numbers ending in '1'. Some languages have singular, dual, and
>> plural. Etc. It's surprising how inventive
On Sun, Jun 23, 2013 at 1:22 PM, Steven D'Aprano
wrote:
> On Sat, 22 Jun 2013 23:12:49 -0400, Roy Smith wrote:
>
>> In article <51c66455$0$2$c3e8da3$54964...@news.astraweb.com>,
>> Steven D'Aprano wrote:
>>
>>> http://infiniteundo.com/post/25326999628/falsehoods-programmers-
> believe-about-
On Sat, 22 Jun 2013 23:12:49 -0400, Roy Smith wrote:
> In article <51c66455$0$2$c3e8da3$54964...@news.astraweb.com>,
> Steven D'Aprano wrote:
>
>> http://infiniteundo.com/post/25326999628/falsehoods-programmers-
believe-about-
>> time
>
> Number 2 on the list is "Months have either 30 or 3
On Sat, 22 Jun 2013 19:58:38 -0700, Adam wrote:
> class FooBar(object):
> def __init__(self):
> ...
>
> Inheritance usually takes a class name to indicate which class is the
> 'parent' class. However, in the previous example, from a django book,
> the class actually takes an 'object'
In article <51c66455$0$2$c3e8da3$54964...@news.astraweb.com>,
Steven D'Aprano wrote:
> http://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-
> time
Number 2 on the list is "Months have either 30 or 31 days", which was
obviously believed by whoever made this sign: h
On Sat, 22 Jun 2013 19:39:30 -0700, christhecomic wrote:
> Writing simple program asking a question with the answer being
> "yes"...how do I allow the correct answer if user types Yes, yes, or
> YES?
Take the user's input, strip off any whitespace from the beginning and
end, then fold the case t
class FooBar(object):
def __init__(self):
...
Inheritance usually takes a class name to indicate which class is the 'parent'
class. However, in the previous example, from a django book, the class actually
takes an 'object' like parameter, doesn't it? What is the semantics meaning of
On Sun, 23 Jun 2013 02:20:56 +0100, MRAB wrote:
> One vs not-one isn't good enough. Some languages use the singular with
> any numbers ending in '1'. Some languages have singular, dual, and
> plural. Etc. It's surprising how inventive people can be! :-)
This is a good time to link to these intere
On Saturday, June 22, 2013 9:39:30 PM UTC-5, christ...@gmail.com wrote:
> Writing simple program asking a question with the answer being
> "yes"...how do I allow the correct answer if user types Yes,
> yes, or YES?
Here is a clue.
py> 'e' == 'e'
True
py> 'E' == 'E'
True
--
http://mail.p
On Sun, Jun 23, 2013 at 12:39 PM, wrote:
> Writing simple program asking a question with the answer being "yes"...how do
> I allow the correct answer if user types Yes, yes, or YES?
The thing you're looking for is case-folding, or possibly
lower-casing. You should be able to find what you want
Writing simple program asking a question with the answer being "yes"...how do I
allow the correct answer if user types Yes, yes, or YES?
Thanks
--
http://mail.python.org/mailman/listinfo/python-list
On Sun, Jun 23, 2013 at 10:48 AM, Rick Johnson
wrote:
> On Saturday, June 22, 2013 6:12:50 PM UTC-5, Chris Angelico wrote:
>> As a general rule, I don't like separating format strings and their
>> arguments.
>
> Huh? Format strings don't take arguments because Python's built-in string
> type is n
okay i got it thank you all :))
--
http://mail.python.org/mailman/listinfo/python-list
On 06/22/2013 09:20 PM, MRAB wrote:
On 23/06/2013 00:56, Dave Angel wrote:
Certainly the reorderability of the format string is significant. Not
only can it be reordered, but more than one instance of some of the
values is permissible if needed. (What's missing is a decent handling
of
On 23/06/2013 00:56, Dave Angel wrote:
On 06/22/2013 07:37 PM, Chris Angelico wrote:
On Sun, Jun 23, 2013 at 9:28 AM, Dave Angel wrote:
On 06/22/2013 07:12 PM, Chris Angelico wrote:
On Sun, Jun 23, 2013 at 1:24 AM, Rick Johnson
wrote:
_fmtstr = "Item wrote to MongoDB database {0}, {1}
In <54f1fb77-355b-4796-824f-1ee29c402...@googlegroups.com>
=?UTF-8?B?0JHQvtGA0LjRgdC70LDQsiDQkdC+0YDQuNGB0LvQsNCy0L7Qsg==?=
writes:
> > > while 1:
> > > name=raw_input("What is your name? ")
> > > if name == "bobi":
> > print "Hello Master!"
> > break
> > > else:
On 22/06/2013 19:49, Rick Johnson wrote:
On Saturday, June 22, 2013 12:19:31 PM UTC-5, Rotwang wrote:
On 22/06/2013 02:15, Rick Johnson wrote:
IS ALL THIS REGISTERING YET? DO YOU UNDERSTAND?
No, I don't. These two special cases are not sufficient
for me to determine what semantics you are prop
On Saturday, June 22, 2013 6:12:50 PM UTC-5, Chris Angelico wrote:
> As a general rule, I don't like separating format strings and their
> arguments.
Huh? Format strings don't take arguments because Python's built-in string type
is not callable.
py> callable("")
False
"Format string" is ju
On 06/22/2013 08:27 PM, Chris Angelico wrote:
On Sun, Jun 23, 2013 at 9:56 AM, Dave Angel wrote:
On 06/22/2013 07:37 PM, Chris Angelico wrote:
On the contrary, i18n should be done with config files. The format
string
**as specified in the physical program**
is the key to the actual stri
On Sun, Jun 23, 2013 at 9:56 AM, Dave Angel wrote:
> On 06/22/2013 07:37 PM, Chris Angelico wrote:
>>> On the contrary, i18n should be done with config files. The format
>>> string
>
>
> **as specified in the physical program**
>
>
>>> is the key to the actual string which is located in the file/
On 06/22/2013 07:37 PM, Chris Angelico wrote:
On Sun, Jun 23, 2013 at 9:28 AM, Dave Angel wrote:
On 06/22/2013 07:12 PM, Chris Angelico wrote:
On Sun, Jun 23, 2013 at 1:24 AM, Rick Johnson
wrote:
_fmtstr = "Item wrote to MongoDB database {0}, {1}"
msg = _fmtstr.format(_arg1, _arg2)
On Sun, Jun 23, 2013 at 9:28 AM, Dave Angel wrote:
> On 06/22/2013 07:12 PM, Chris Angelico wrote:
>>
>> On Sun, Jun 23, 2013 at 1:24 AM, Rick Johnson
>> wrote:
>>>
>>>_fmtstr = "Item wrote to MongoDB database {0}, {1}"
>>>msg = _fmtstr.format(_arg1, _arg2)
>>
>>
>> As a general rule, I d
On 06/22/2013 07:12 PM, Chris Angelico wrote:
On Sun, Jun 23, 2013 at 1:24 AM, Rick Johnson
wrote:
_fmtstr = "Item wrote to MongoDB database {0}, {1}"
msg = _fmtstr.format(_arg1, _arg2)
As a general rule, I don't like separating format strings and their
arguments. That's one of the more
On Sun, Jun 23, 2013 at 1:24 AM, Rick Johnson
wrote:
> _fmtstr = "Item wrote to MongoDB database {0}, {1}"
> msg = _fmtstr.format(_arg1, _arg2)
As a general rule, I don't like separating format strings and their
arguments. That's one of the more annoying costs of i18n. Keep them in
a single e
On Sat, Jun 22, 2013 at 3:50 PM, Борислав Бориславов
wrote:
> this doesent help me at all
It shows you how to include multiple statements in the body of the if
block. If you're having trouble getting it to work, then please copy
and paste the exact code that you're running for us along with the
23 юни 2013, неделя, 00:46:37 UTC+3, Peter Otten написа:
> Борислав Бориславов wrote:
>
>
>
> > while 1:
>
> > name=raw_input("What is your name? ")
>
> > if name == "bobi": print "Hello Master!" and break
>
> > else: print "error"
>
>
>
> > I want if my conditions are met to d
On 22/06/2013 22:31, Борислав Бориславов wrote:
while 1:
name=raw_input("What is your name? ")
if name == "bobi": print "Hello Master!" and break
else: print "error"
I want if my conditions are met to do a couple of things and i cant do that
You most certainly can :)
while 1:
Борислав Бориславов wrote:
> while 1:
> name=raw_input("What is your name? ")
> if name == "bobi": print "Hello Master!" and break
> else: print "error"
> I want if my conditions are met to do a couple of things and i cant do
> that
> while 1:
> name=raw_input("What is your name?
while 1:
name=raw_input("What is your name? ")
if name == "bobi": print "Hello Master!" and break
else: print "error"
I want if my conditions are met to do a couple of things and i cant do that
--
http://mail.python.org/mailman/listinfo/python-list
On 22/06/2013 03:32, Rick Johnson wrote:
On Friday, June 21, 2013 8:54:50 PM UTC-5, MRAB wrote:
On 22/06/2013 00:51, Rick Johnson wrote:
> On Friday, June 21, 2013 5:49:51 PM UTC-5, MRAB wrote:
> My argument has always been that mutables should not be
> passed into subroutines as default argumen
In article
,
Mark Janssen wrote:
> > Also remember when entering long lines of text that strings concatenate
> > within parenthesis.
> > So,
> > ("a, b, c"
> > "d, e, f"
> > "g, h, i")
> >
> > Is the same as ("a, b, cd, e, fg, h, i")
> There was a recent discussion about this (under "implicit s
On Sat, Jun 22, 2013 at 10:49 AM, Dennis Lee Bieber
wrote:
> On Fri, 21 Jun 2013 19:27:42 -0600, Ian Kelly
> declaimed the following:
>
>>While we're at it, I would like to petition for a function
>>terminates(f, args) that I can use to determine whether a function
>>will terminate before I actua
On Saturday, June 22, 2013 12:19:31 PM UTC-5, Rotwang wrote:
> > On 22/06/2013 02:15, Rick Johnson wrote:
> > IS ALL THIS REGISTERING YET? DO YOU UNDERSTAND?
>
> No, I don't. These two special cases are not sufficient
> for me to determine what semantics you are proposing for
> the general case.
On 22 June 2013 18:28, Alister wrote:
> On Sat, 22 Jun 2013 17:11:00 +0100, Joshua Landau wrote:
>
>> On 22 June 2013 16:55, Rick Johnson
>> wrote:
>>> On Saturday, June 22, 2013 10:40:24 AM UTC-5, Joshua Landau wrote:
> Plus, your use of the format syntax is incorrect.
Wut?
>>>
>>> Wel
> Also remember when entering long lines of text that strings concatenate
> within parenthesis.
> So,
> ("a, b, c"
> "d, e, f"
> "g, h, i")
>
> Is the same as ("a, b, cd, e, fg, h, i")
There was a recent discussion about this (under "implicit string
concatenation"). It seems this is a part of the
On Sat, 22 Jun 2013 17:11:00 +0100, Joshua Landau wrote:
> On 22 June 2013 16:55, Rick Johnson
> wrote:
>> On Saturday, June 22, 2013 10:40:24 AM UTC-5, Joshua Landau wrote:
>>> > Plus, your use of the format syntax is incorrect.
>>> Wut?
>>
>> Well what i mean exactly is not that it's illegal, i
On 22/06/2013 03:01, I wrote:
On 22/06/2013 02:15, Rick Johnson wrote:
[...]
This is what should happen:
py> def foo(arg=[]):
... arg.append(1)
... print(arg)
...
py> foo()
[1]
py> foo()
[1]
py> foo()
[1]
Yes, Yes, YES! That is intuiti
On Saturday, June 22, 2013 8:37:20 PM UTC+5:30, Rick Johnson wrote:
> I sorry, but FP is not going to wash our sins clean. In
> fact, if taken too seriously, FP leads to preaching
> professors, intellectually unstimulated students, and
> semesters of wasted time that could have been better spent
>
On 22 June 2013 16:55, Rick Johnson wrote:
> On Saturday, June 22, 2013 10:40:24 AM UTC-5, Joshua Landau wrote:
>> > Plus, your use of the format syntax is incorrect.
>> Wut?
>
> Well what i mean exactly is not that it's illegal, i just
> find the use of the "getattr sugar", from WITHIN the format
On Saturday, June 22, 2013 10:40:24 AM UTC-5, Joshua Landau wrote:
> > Plus, your use of the format syntax is incorrect.
> Wut?
Well what i mean exactly is not that it's illegal, i just
find the use of the "getattr sugar", from WITHIN the format
string, to be excessively noisy.
In short, i don't
On 22 June 2013 14:36, Joshua Landau wrote:
> My favourite way would be along the lines of:
>
> message = "Item wrote to MongoDB database "
> message += "{0[MONGODB_DB]}/{0[MONGODB_COLLECTION]}".format(settings)
> log.msg(message, level=log.DEBUG, spider=spider)
To make a habit of replying to mys
On 22 June 2013 16:24, Rick Johnson wrote:
> On Saturday, June 22, 2013 8:36:43 AM UTC-5, Joshua Landau wrote:
>> message = "Item wrote to MongoDB database "
>> message += "{0[MONGODB_DB]}/{0[MONGODB_COLLECTION]}".format(settings)
>> log.msg(message, level=log.DEBUG, spider=spider)
>
> If you're g
On Saturday, June 22, 2013 8:37:20 PM UTC+5:30, Rick Johnson wrote:
> > So for example, if the use-case contained a statement
> > like: In order to safeguard customer-satisfaction, the
> > ATM's performance shall not degrade beyond 3 seconds
> > response time.
> > So now - according to our methodol
On Saturday, June 22, 2013 8:36:43 AM UTC-5, Joshua Landau wrote:
> message = "Item wrote to MongoDB database "
> message += "{0[MONGODB_DB]}/{0[MONGODB_COLLECTION]}".format(settings)
> log.msg(message, level=log.DEBUG, spider=spider)
If you're going to whore out parts of the string to
variables i
> See my blog [...]
> for a history of wishes akin to yours and lessons not
> learnt. In short the problems accruing from unconstrained
> imperative programming are severe and the solutions are
> hard. In the meanwhile, goals such as your 'keep-
> procedures-stateless' can and should certainly be
>
Op 22-06-13 03:27, Ian Kelly schreef:
On Fri, Jun 21, 2013 at 7:15 PM, Steven D'Aprano
wrote:
On Fri, 21 Jun 2013 23:49:51 +0100, MRAB wrote:
On 21/06/2013 21:44, Rick Johnson wrote:
[...]
Which in Python would be the "MutableArgumentWarning".
*school-bell*
I notice that you've omitted
On 22/06/2013 14:36, Joshua Landau wrote:
On 21 June 2013 23:26, Gary Herron wrote:
On 06/21/2013 02:17 PM, Yves S. Garret wrote:
I have the following line of code:
log.msg("Item wrote to MongoDB database %s/%s" %(settings['MONGODB_DB'],
settings['MONGODB_COLLECTION']), level=log.DEBUG, spider
On 22 June 2013 14:36, Joshua Landau wrote:
> message = "Item wrote to MongoDB database "
Pedant's note:
"Item *written* to MongoDB database"
--
http://mail.python.org/mailman/listinfo/python-list
On 21 June 2013 23:26, Gary Herron wrote:
> On 06/21/2013 02:17 PM, Yves S. Garret wrote:
>> I have the following line of code:
>> log.msg("Item wrote to MongoDB database %s/%s" %(settings['MONGODB_DB'],
>> settings['MONGODB_COLLECTION']), level=log.DEBUG, spider=spider)
<...>
>> I was thinking of
Chris Angelico wrote:
> On Fri, Jun 21, 2013 at 7:15 PM, Peter Otten <__pete...@web.de> wrote:
>> Combining these modifications:
>>
>> for line in f:
>> word = line.strip()
>> if is_palindrome.is_palindrome(word):
>> print word
>
> Minor quibble: I wouldn't use the name 'word' her
On Fri, Jun 21, 2013 at 7:15 PM, Peter Otten <__pete...@web.de> wrote:
> Combining these modifications:
>
> for line in f:
> word = line.strip()
> if is_palindrome.is_palindrome(word):
> print word
Minor quibble: I wouldn't use the name 'word' here, unless you're
expecting the file
On 22/06/2013 02:31, Steven D'Aprano wrote:
On Sat, 22 Jun 2013 05:07:59 +1000, Chris Angelico wrote:
Oh! I know. Function argument defaults will now be restricted to
int/float/tuple. That would do it, right? Nobody would be bothered by
little restrictions like that, would they.
Alas, tuples
"Yves S. Garret" writes:
> I have the following line of code:
> log.msg("Item wrote to MongoDB database %s/%s" %(settings['MONGODB_DB'],
> settings['MONGODB_COLLECTION']), level=log.DEBUG, spider=spider)
[…]
> Is this ok? Are there any rules in Python when it comes to breaking up
> long lines of
56 matches
Mail list logo