comp.lang.python - 26 new messages in 17 topics - digest
comp.lang.python
http://groups.google.com/group/comp.lang.python?hl=en
comp.lang.python@googlegroups.com
Today's topics:
* with statement and standard library - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/4b6ab7a13372e7ff?hl=en
* Few questions on SOAP - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/3808b1054771aa1c?hl=en
* How to make an empty generator? - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/7320d6a8eabd2152?hl=en
* "SEXY Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela" "
pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD
GIRLS" - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/8fe9b7937c4218cc?hl=en
* PAPER PRESENTATIONS AND SEMIMAR TOPICS. - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/42c1bbefe506edef?hl=en
* Why this doesn't work? - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/698b29e4a1bebed4?hl=en
* How to use AWS/PAA nowadays? PyAWS / pyamazon outdated? - 1 messages, 1
author
http://groups.google.com/group/comp.lang.python/t/2af80dde4a3a124e?hl=en
* Interesting talk on Python vs. Ruby and how he would like Python to have
just a bit more syntactic flexibility. - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/9a88c79d4043ba30?hl=en
* Constraints on __sub__, __eq__, etc. - 3 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/98434610aa827c3c?hl=en
* look at the google code - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/08a617c391803ad0?hl=en
* The Disappearing Program? - 4 messages, 3 authors
http://groups.google.com/group/comp.lang.python/t/5afb8403aa0cd181?hl=en
* how to do filetransfer using usrp. - 2 messages, 2 authors
http://groups.google.com/group/comp.lang.python/t/6267cb0a8bc973df?hl=en
* Ann innovative shopping mail easily!!!!!!!!!!!!!!!!!!!!!! - 1 messages, 1
author
http://groups.google.com/group/comp.lang.python/t/979bfcedac87d451?hl=en
* Legit Online Jobs - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/ad1b920615298105?hl=en
* Amazing Cover Letters - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/5b84decaa98e9d90?hl=en
* beautiful indian girls see and enjoy - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/f0906f73ae7c35fc?hl=en
* What happened to pyjamas? - 1 messages, 1 author
http://groups.google.com/group/comp.lang.python/t/4480c0898703d657?hl=en
==============================================================================
TOPIC: with statement and standard library
http://groups.google.com/group/comp.lang.python/t/4b6ab7a13372e7ff?hl=en
==============================================================================
== 1 of 2 ==
Date: Thurs, Feb 18 2010 11:18 pm
From: nobrowser
Hi. The with statement is certainly nifty. The trouble is, the
*only* two documented examples how it can be used with the library
classes are file objects (which I use all the time) and thread locks
which I almost never use. Yet there are many, many classes in the
library whose use would be more elegant and readable if the with
statement could be employed. Start with the connection objects in
httplib and you can probably come up with 10 others easily. Maybe it
is the case that some of these classes have with statement support
already but I don't know it? If so, how can I know (without asking
here each time, LOL)? If not, is there work being done on that?
I am interested in this question mostly in the context of Python 2.6.
Many thanks.
== 2 of 2 ==
Date: Fri, Feb 19 2010 4:25 am
From: alex23
nobrowser <nobrow...@gmail.com> wrote:
> Yet there are many, many classes in the
> library whose use would be more elegant and readable if the with
> statement could be employed. Start with the connection objects in
> httplib and you can probably come up with 10 others easily. Maybe it
> is the case that some of these classes have with statement support
> already but I don't know it? If so, how can I know (without asking
> here each time, LOL)? If not, is there work being done on that?
If an object has __enter__ and __exit__ methods, it should work as a
context manager.
If you do find any such classes, submitting doc bugs or patches would
be really handy.
However, I'm not sure if there was any attempt to retrofit the stdlib
with context manager supports, so if you do come up with more elegant
approaches, please contribute them, we'll all thank you :)
==============================================================================
TOPIC: Few questions on SOAP
http://groups.google.com/group/comp.lang.python/t/3808b1054771aa1c?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 12:35 am
From: joy99
On Feb 19, 8:49 am, Steve Holden <st...@holdenweb.com> wrote:
> Brendon Wickham wrote:
> > On 19 February 2010 08:07, Mark Lawrence <breamore...@yahoo.co.uk> wrote:
> >> Muhammad Alkarouri wrote:
> >>> Your question is borderline if not out of topic in this group. I will
> >>> make a few comments though.
> >> This might be a Python group, but threads often drift way off topic, which
> >> added to the language itself make this a great group to read. If you don't
> >> like the way a thread goes, you can always skip it.
>
> > Perhaps...but he answered the question very well and with great, IMO, patience.
>
> +1
> --
> Steve Holden +1 571 484 6266 +1 800 494 3119
> PyCon is coming! Atlanta, Feb 2010 http://us.pycon.org/
> Holden Web LLC http://www.holdenweb.com/
> UPCOMING EVENTS: http://holdenweb.eventbrite.com/
Dear Group,
Thank you for taking your time to discuss the issue, esp. to Mohammad
for his great patience and solving each aspect in a great way.
That's I frequent this group and I just learn lot. If it is bit
diverted topic,sorry.
Wishing you Happy Day Ahead,
Best Regards,
Subhabrata.
==============================================================================
TOPIC: How to make an empty generator?
http://groups.google.com/group/comp.lang.python/t/7320d6a8eabd2152?hl=en
==============================================================================
== 1 of 2 ==
Date: Fri, Feb 19 2010 12:36 am
From: Arnaud Delobelle
Ben Finney <ben+python@benfinney.id.au> writes:
> Arnaud Delobelle <arnodel@googlemail.com> writes:
>
>> What about
>> foo = iter('')
>
> That doesn't return a generator.
>
> >>> foo = iter('')
> >>> foo
> <listiterator object at 0xf7cd3ed0>
>
> Whether the OP needs to create a generator, or just any iterable type,
> isn't clear.
If it walks and quacks like a duck... Anyway it's not just an iterable
object, it's an iterator. I can't really imagine that there would be
some code which would be happy with generators but not with iterators
(as long as you can't send anything to them, which is always the case
with an empty generator).
--
Arnaud
== 2 of 2 ==
Date: Fri, Feb 19 2010 12:52 am
From: Ben Finney
Arnaud Delobelle <arnodel@googlemail.com> writes:
> Ben Finney <ben+python@benfinney.id.au> writes:
> > Whether the OP needs to create a generator, or just any iterable
> > type, isn't clear.
>
> If it walks and quacks like a duck... Anyway it's not just an iterable
> object, it's an iterator. I can't really imagine that there would be
> some code which would be happy with generators but not with iterators
> (as long as you can't send anything to them, which is always the case
> with an empty generator).
I can't imagine that someone would want to create a generator that's
always empty, but has some side-effect that is the *real* purpose for
using the generator.
Clearly, none of us should let our limited imaginations be the guide to
what people actually want to do.
--
\ "Generally speaking, the errors in religion are dangerous; |
`\ those in philosophy only ridiculous." —David Hume, _A Treatise |
_o__) of Human Nature_, 1739 |
Ben Finney
==============================================================================
TOPIC: "SEXY Pamela Anderson" "hollywood actress" "hollywood wallpapers" "
pamela" "pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.
blogspot.com/ "pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "
SEXY HOLLYWOOD GIRLS"
http://groups.google.com/group/comp.lang.python/t/8fe9b7937c4218cc?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 12:47 am
From: Naeem
"SEXY Pamela Anderson" "hollywood actress" "hollywood wallpapers"
"pamela" "pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" "SEXY Pamela Anderson" "hollywood actress"
"hollywood wallpapers" "pamela" "pamela" "pamela and" "pamela and" ON
http://sexyandpretty-girls.blogspot.com/ "pamela ander" "pamela
ander" "pamela ander" "SEXY USA GIRLS" "SEXY HOLLYWOOD GIRLS" "SEXY
Pamela Anderson" "hollywood actress" "hollywood wallpapers" "pamela"
"pamela" "pamela and" "pamela and" ON http://sexyandpretty-girls.blogspot.com/
"pamela ander" "pamela ander" "pamela ander" "SEXY USA GIRLS" "SEXY
HOLLYWOOD GIRLS" VV
==============================================================================
TOPIC: PAPER PRESENTATIONS AND SEMIMAR TOPICS.
http://groups.google.com/group/comp.lang.python/t/42c1bbefe506edef?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 12:49 am
From: hot girl
PAPER PRESENTATIONS AND SEMIMAR TOPICS.
CHECK OUR VAST PAPER PRESENTATIONS AND SEMIMAR TOPICS INCLUDING
PROJECTS FOR FREE AT
http://presentationsandseminars.blogspot.com
==============================================================================
TOPIC: Why this doesn't work?
http://groups.google.com/group/comp.lang.python/t/698b29e4a1bebed4?hl=en
==============================================================================
== 1 of 2 ==
Date: Fri, Feb 19 2010 1:23 am
From: Bruno Desthuilliers
mk a écrit :
>
(snip)
Sorry, no time to get into details now - but I can at least provide a
couple hints.
The first point is that, to override a method on an _instance_, you have
to provide a method object, not a plain function - remember that the
descriptor protocol is only invoked on _class_ attributes, not on
instance attributes.
class Foo(object):
def bar(self):
print "the original bar"
def mybar(self):
print "mybar"
>>> f = Foo()
>>> f.bar = mybar
>>> f.bar()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/tmp/python-1287O_i.py", line 32, in <module>
f.bar()
TypeError: mybar() takes exactly 1 argument (0 given)
>>> type(f.bar)
<type 'function'>
>>> f.bar is mybar
True
>>> f.bar(f)
mybar
As you see, "bar" is here resolved as an ordinary instance attribute -
so here it evals to the "mybar" function object. If you want it to be a
method object, you do have to invoke the descriptor protocol manually:
>>> f.bar = mybar.__get__(f, type(f))
>>> f.bar
<bound method Foo.mybar of <__main__.Foo object at 0xb7e16b0c>>
>>> f.bar()
mybar
Or alternatively, you can use the types module:
>>> import types
>>> f.bar = types.MethodType(mybar, f, type(f))
>>> f.bar
<bound method Foo.mybar of <__main__.Foo object at 0xb7e16b0c>>
>>> f.bar()
mybar
Second point is that the descriptor protocol is invoked on each and
every lookup. So when it comes to function class attributes, you get a
new method object each time:
>>> f = Foo()
>>> m1 = f.bar
>>> m1
<bound method Foo.bar of <__main__.Foo object at 0xb7cb522c>>
>>> m2 = f.bar
>>> m2
<bound method Foo.bar of <__main__.Foo object at 0xb7cb522c>>
>>> id(m1)
3084861188L
>>> id(m2)
3083656564L
>>> m1 is m2
False
>>>
I think this should help you understand why your code doesn't work as
you assumed it would !-)
PS : as a side note, a common optimization trick is to "short-circuit"
the whole lookup / descriptor mechanism when you have to call the same
method of the same object in a loop:
l = []
append = l.append
for i in xrange(100):
append(i)
print l
HTH
== 2 of 2 ==
Date: Fri, Feb 19 2010 6:39 am
From: mk
Steven D'Aprano wrote:
> On Thu, 18 Feb 2010 18:28:44 +0100, mk wrote:
>
>> nostat.__orig_get__ = nostat.__get__
>
> I should point out that leading-and-trailing-double-underscore names are
> reserved for use by the language.
Right... I completely missed that. I will try to change the habit.
I am under impression that a function with no underscore in name is
meant to be called "publicly" on instance, like Foo().nostat, a function
with one underscore (and no trailing underscores) is meant to be like
"it's mostly intended for internal use, but you can still call it",
somewhat like "protected" in C++, and a function with two leading
underscores (and no trailing underscores) is meant as completely
internal to the class, not meant to be called by outsiders, somewhat
like "private" in C++ (I abstract from obvious point in C++ that
semantics of those keywords is enforced by a compiler in C++).
Is that correct?
Regards,
mk
==============================================================================
TOPIC: How to use AWS/PAA nowadays? PyAWS / pyamazon outdated?
http://groups.google.com/group/comp.lang.python/t/2af80dde4a3a124e?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 1:44 am
From: Snaky Love
wow, for some strange reason I did not find this with my first search
yesterday:
http://pypi.python.org/pypi/python-amazon-product-api/0.2.2
I will try this.
sometime I wish all the old stuff would disappear from the internet.
if somebody is looking for a cool startup idea: what about some
website overlay that says "hey, dude, this stuff is old, go here, here
is the new and improved thing!" :)
thanks for your attention.
==============================================================================
TOPIC: Interesting talk on Python vs. Ruby and how he would like Python to
have just a bit more syntactic flexibility.
http://groups.google.com/group/comp.lang.python/t/9a88c79d4043ba30?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 2:01 am
From: Anh Hai Trinh
On Feb 19, 1:44 pm, Steve Howell <showel...@yahoo.com> wrote:
>
> > def coroutine(co):
> > def _inner(*args, **kwargs):
> > gen = co(*args, **kwargs)
> > gen.next()
> > return gen
> > return _inner
>
> > def squares_and_cubes(lst, target):
> > for n in lst:
> > target.send((n * n, n * n * n))
>
> > @coroutine
> > def reject_bad_values(target):
> > while True:
> > square, cube = (yield)
> > if not (square == 25 or cube == 64):
> > target.send((square, cube))
>
> > @coroutine
> > def cubes_only(target):
> > while True:
> > square, cube = (yield)
> > target.send(cube)
>
> > @coroutine
> > def print_results():
> > while True:
> > print (yield)
>
> > squares_and_cubes(range(10),
> > reject_bad_values(
> > cubes_only(
> > print_results()
> > )
> > )
> > )
>
> Wow! It took me a while to get my head around it, but that's pretty
> cool.
This pipeline idea has actually been implemented further, see <http://
blog.onideas.ws/stream.py>.
from stream import map, filter, cut
range(10) >> map(lambda x: [x**2, x**3]) >> filter(lambda t: t[0]!
=25 and t[1]!=64) >> cut[1] >> list
[0, 1, 8, 27, 216, 343, 512, 729]
--
aht
==============================================================================
TOPIC: Constraints on __sub__, __eq__, etc.
http://groups.google.com/group/comp.lang.python/t/98434610aa827c3c?hl=en
==============================================================================
== 1 of 3 ==
Date: Fri, Feb 19 2010 2:30 am
From: Roald de Vries
On Feb 18, 2010, at 5:28 PM, Stephen Hansen wrote:
> On Thu, Feb 18, 2010 at 8:19 AM, Andrey Fedorov
> <anfedorov@gmail.com>wrote:
>> It seems intuitive to me that the magic methods for overriding the
>> +, -, <, ==, >, etc. operators should have no sideffects on their
>> operands. Also, that == should be commutative and transitive, that
>> > and < should be transitive, and anti-commutative.
>>
>> Is this intuition written up in a PEP, or assumed to follow from
>> the mathematical meanings?
>
> It may be intuitive to you, but its not true, written down anywhere,
> nor assumed by the language, and the mathematical meaning of the
> operators doesn't matter to Python. Python purposefully does not
> enforce anything for these methods.
Still, it's clear that (for example) '==' is not just a normal
function call. Look at this example (in ipython):
>>> False == False == False
True
>>> True == False == False
False
>>> (True == False) == False
True
Anybody knows how why this is so?
== 2 of 3 ==
Date: Fri, Feb 19 2010 2:39 am
From: Chris Rebert
On Fri, Feb 19, 2010 at 2:30 AM, Roald de Vries <rdv@roalddevries.nl> wrote:
> On Feb 18, 2010, at 5:28 PM, Stephen Hansen wrote:
>> On Thu, Feb 18, 2010 at 8:19 AM, Andrey Fedorov
>> <anfedorov@gmail.com>wrote:
>>>
>>> It seems intuitive to me that the magic methods for overriding the +, -,
>>> <, ==, >, etc. operators should have no sideffects on their operands. Also,
>>> that == should be commutative and transitive, that > and < should be
>>> transitive, and anti-commutative.
>>>
>>> Is this intuition written up in a PEP, or assumed to follow from the
>>> mathematical meanings?
>>
>> It may be intuitive to you, but its not true, written down anywhere, nor
>> assumed by the language, and the mathematical meaning of the operators
>> doesn't matter to Python. Python purposefully does not enforce anything for
>> these methods.
>
> Still, it's clear that (for example) '==' is not just a normal function
> call. Look at this example (in ipython):
>
>>>> False == False == False
> True
>>>> True == False == False
> False
>>>> (True == False) == False
> True
>
> Anybody knows how why this is so?
Python is smart enough to recognize chained comparisons and do The
Right Thing (tm).
`X == Y == Z` is equivalent to `X == Y and Y == Z`. Same goes for the
other comparison operators besides == and also possibly for longer
chains.
Cheers,
Chris
--
http://blog.rebertia.com
== 3 of 3 ==
Date: Fri, Feb 19 2010 3:30 am
From: Peter Otten <__peter__@web.de>
Roald de Vries wrote:
> On Feb 18, 2010, at 5:28 PM, Stephen Hansen wrote:
>> On Thu, Feb 18, 2010 at 8:19 AM, Andrey Fedorov
>> <anfedorov@gmail.com>wrote:
>>> It seems intuitive to me that the magic methods for overriding the
>>> +, -, <, ==, >, etc. operators should have no sideffects on their
>>> operands. Also, that == should be commutative and transitive, that
>>> > and < should be transitive, and anti-commutative.
>>>
>>> Is this intuition written up in a PEP, or assumed to follow from
>>> the mathematical meanings?
>>
>> It may be intuitive to you, but its not true, written down anywhere,
>> nor assumed by the language, and the mathematical meaning of the
>> operators doesn't matter to Python. Python purposefully does not
>> enforce anything for these methods.
>
> Still, it's clear that (for example) '==' is not just a normal
> function call. Look at this example (in ipython):
>
> >>> False == False == False
> True
> >>> True == False == False
> False
> >>> (True == False) == False
> True
>
> Anybody knows how why this is so?
As Chris said
expr1 <op1> expr2 <op2> expr3 <op3> ...
is resolved as
(expr1 <op1> expr2) and (expr2 <op2> expr3) and (expr3 <op3> ...
where each exprN is evaluated just once.
For this to become the obvious way you have to look at interval checks like
a < b < c
Peter
==============================================================================
TOPIC: look at the google code
http://groups.google.com/group/comp.lang.python/t/08a617c391803ad0?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 2:41 am
From: Allison Vollmann
http://code.google.com/p/pyjamas/
Last update from yesterday, is the same project?
==============================================================================
TOPIC: The Disappearing Program?
http://groups.google.com/group/comp.lang.python/t/5afb8403aa0cd181?hl=en
==============================================================================
== 1 of 4 ==
Date: Fri, Feb 19 2010 3:20 am
From: "W. eWatson"
I've successfully compiled several small python programs on Win XP into
executables using py2exe. A program goes from a name like snowball.py to
snowball. A dir in the command prompt window finds snowball.py but not
snowball. If I type in snowball, it executes. What's up with that?
== 2 of 4 ==
Date: Fri, Feb 19 2010 5:04 am
From: Andre Engels
On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson <wolftracks@invalid.com> wrote:
> I've successfully compiled several small python programs on Win XP into
> executables using py2exe. A program goes from a name like snowball.py to
> snowball. A dir in the command prompt window finds snowball.py but not
> snowball. If I type in snowball, it executes. What's up with that?
No idea whether it has to do with your problem, but if it's executable
in Windows, its name is snowball.exe, not snowball.
--
André Engels, andreengels@gmail.com
== 3 of 4 ==
Date: Fri, Feb 19 2010 6:19 am
From: Mark Lawrence
Andre Engels wrote:
> On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson <wolftracks@invalid.com> wrote:
>> I've successfully compiled several small python programs on Win XP into
>> executables using py2exe. A program goes from a name like snowball.py to
>> snowball. A dir in the command prompt window finds snowball.py but not
>> snowball. If I type in snowball, it executes. What's up with that?
>
> No idea whether it has to do with your problem, but if it's executable
> in Windows, its name is snowball.exe, not snowball.
>
Not necessarily, it's perfectly possible to setup a Python script to run
on Windows using file associations in the same way that you can run a
command (.bat) file. If the OP types the command "ASSOC .py" without
the quotes at the command prompt, the response .py=Python.File tells you
that this association has been setup.
HTH.
Mark Lawrence.
== 4 of 4 ==
Date: Fri, Feb 19 2010 6:33 am
From: Andre Engels
On Fri, Feb 19, 2010 at 3:19 PM, Mark Lawrence <breamoreboy@yahoo.co.uk> wrote:
> Andre Engels wrote:
>>
>> On Fri, Feb 19, 2010 at 12:20 PM, W. eWatson <wolftracks@invalid.com>
>> wrote:
>>>
>>> I've successfully compiled several small python programs on Win XP into
>>> executables using py2exe. A program goes from a name like snowball.py to
>>> snowball. A dir in the command prompt window finds snowball.py but not
>>> snowball. If I type in snowball, it executes. What's up with that?
>>
>> No idea whether it has to do with your problem, but if it's executable
>> in Windows, its name is snowball.exe, not snowball.
>>
>
> Not necessarily, it's perfectly possible to setup a Python script to run on
> Windows using file associations in the same way that you can run a command
> (.bat) file. If the OP types the command "ASSOC .py" without the quotes at
> the command prompt, the response .py=Python.File tells you
> that this association has been setup.
And how does that invalidate what I wrote? One cannot associate the
empty extension, so if "snowball" runs a program, that's the program
in the file "snowball.exe" not the program in the file "snowball" that
has its extension associated to something - it has no extension, so
its extension cannot be associated.
--
André Engels, andreengels@gmail.com
==============================================================================
TOPIC: how to do filetransfer using usrp.
http://groups.google.com/group/comp.lang.python/t/6267cb0a8bc973df?hl=en
==============================================================================
== 1 of 2 ==
Date: Fri, Feb 19 2010 3:38 am
From: sarosh
how to do filetransfer using usrp.
can i make lan interface between two computers connected to usrp each and
then transfer files (images/video) between them?
how to transfer files?
is there any example of such kind in gnuradio?
sarosh
--
View this message in context: http://old.nabble.com/how-to-do-filetransfer-using-usrp.-tp27652452p27652452.html
Sent from the Python - python-list mailing list archive at Nabble.com.
== 2 of 2 ==
Date: Fri, Feb 19 2010 6:40 am
From: Justin Ezequiel
On Feb 19, 7:38 pm, sarosh <sarosh.n...@hotmail.com> wrote:
> how to do filetransfer using usrp.
> can i make lan interface between two computers connected to usrp each and
> then transfer files (images/video) between them?
> how to transfer files?
> is there any example of such kind in gnuradio?
>
> sarosh
am not sure what USRP is but a quick google found
http://packages.debian.org/sid/python-usrp
==============================================================================
TOPIC: Ann innovative shopping mail easily!!!!!!!!!!!!!!!!!!!!!!
http://groups.google.com/group/comp.lang.python/t/979bfcedac87d451?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 3:50 am
From: pichu pichandi
We have lot of social networking websites like Twitter, Orkut. But I
searched for a good site for shopping through social networking. I
found this website .
http://www.shoppingreps.com?SourceId=1249 very cool and interesting. I
search for a washing machine, their inventory is very bad I can't
find. I found an innovation they allowed the customers to add any
goods to their inventory and register for them. I added my item and
registered for that. The site says they will check if my item is
available in the market. If it is available they will approve my new
inventory and my group will be available for anybody else to join. It
is fascinating, but time consuming. I am waiting.
Please see this site http://www.shoppingreps.com?SourceId=1249
and try to join if anybody interested.
==============================================================================
TOPIC: Legit Online Jobs
http://groups.google.com/group/comp.lang.python/t/ad1b920615298105?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 5:28 am
From: Scott Gregoire
What If I Could Show You A Legit System You Can Use to Put $200 -
$500 Per Day Into Your Account, Working From The Comfort of Your
Home... Would You Be Interested? Read More >>> http://bit.ly/Legit-Jobs
<<<
==============================================================================
TOPIC: Amazing Cover Letters
http://groups.google.com/group/comp.lang.python/t/5b84decaa98e9d90?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 5:46 am
From: Scott Gregoire
Stop writing cover letters the hard way! Here's how to get your phone
ringing off the hook with more quality job interviews and job offers
faster than you could ever imagine... Read More >> http://bit.ly/cbQ3Ko
==============================================================================
TOPIC: beautiful indian girls see and enjoy
http://groups.google.com/group/comp.lang.python/t/f0906f73ae7c35fc?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 6:30 am
From: preety preety
http://teluguscope.com/allfiles/galleryfiles/actressindexfiles/angelinajolieindex.html
http://teluguscope.com/allfiles/galleryfiles/actressindexfiles/saniamirzaindex.html
http://teluguscope.com/allfiles/galleryfiles/actressindexfiles/aishwaryaraiindex.html
http://teluguscope.com/allfiles/galleryfiles/actressindexfiles/kareenakapoorindex.html
http://teluguscope.com/allfiles/galleryfiles/actressindexfiles/rambhaindex.html
http://teluguscope.com/allfiles/galleryfiles/actressindexfiles/trishaindex.html
http://teluguscope.com/allfiles/galleryfiles/actressindexfiles/namitaindex.html
==============================================================================
TOPIC: What happened to pyjamas?
http://groups.google.com/group/comp.lang.python/t/4480c0898703d657?hl=en
==============================================================================
== 1 of 1 ==
Date: Fri, Feb 19 2010 6:41 am
From: Daniele Gondoni
On Feb 18, 9:53 pm, Irmen de Jong <ir...@-NOSPAM-xs4all.nl> wrote:
> On 2/18/10 9:45 PM, Luis M. González wrote:
>
> > On Feb 18, 5:21 pm, Daniele Gondoni<daniele.gond...@gmail.com> wrote:
> >> On 18 Feb, 19:58, "sstein...@gmail.com"<sstein...@gmail.com> wrote:
>
> >>> Down from here (NH, US).
>
> >>> S
>
> >>> On Feb 18, 2010, at 1:44 PM, Chris Colbert wrote:
>
> >> Unreacheable from Italy as well...
>
> > Same here (Buenos Aires, Argentina).
>
> It ain't down till Netcraft confirms it!
>
> http://uptime.netcraft.com/up/graph?site=www.pyjs.org
>
> Oh wait...
>
> -irmen
my goodness! it seems only the domain has expired
the site's still there, just add
216.34.181.97 pyjs.org
to your hosts file and BANG
==============================================================================
You received this message because you are subscribed to the Google Groups "comp.lang.python"
group.
To post to this group, visit http://groups.google.com/group/comp.lang.python?hl=en
To unsubscribe from this group, send email to comp.lang.python+unsubscribe@googlegroups.com
To change the way you get mail from this group, visit:
http://groups.google.com/group/comp.lang.python/subscribe?hl=en
To report abuse, send email explaining the problem to abuse@googlegroups.com
==============================================================================
Google Groups: http://groups.google.com/?hl=en
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home