* Thorsten Kampe (Sat, 28 May 2011 08:38:54 +0200)
> My experience is: unless the code is especially written with Python3
> compatability [...]
Oops, I meant "unless the code is specifically written with Python3
compatability in mind [...]"
Thorsten
--
http://mail.python.org/mailman/listinfo/py
On Sat, May 28, 2011 at 4:38 PM, Thorsten Kampe
wrote:
> The question is: if you want (or have) to run your code under Python3,
> how likely is that it will run unmodified? My experience is: unless the
> code is especially written with Python3 compatability or just a short
> snippet, it's actually
* Thomas Rachel (Sat, 28 May 2011 07:06:53 +0200)
> Am 27.05.2011 17:52 schrieb Steven D'Aprano:
> > On Fri, 27 May 2011 09:40:53 -0500, harrismh777 wrote:
> >> 3.x is completely incompatible with 2.x (some call it a dialect,
> >> but that is a lie).
> >
> > "Completely incompatible"? A "lie"?
>
>
On Fri, 27 May 2011 15:40:53 -0500, harrismh777 wrote:
> Steven D'Aprano wrote:
>> Would you care to revise your claims?
>
> No.
>
>
> You have erected a straw-man... once again.
You keep using that term, but it is clear to me that you don't have the
foggiest idea of what the straw-man fallac
On May 20, 12:00 am, Jonathan de Boyne Pollard wrote:
> Indeed. And the algorithms that are employed to perform the operations
> so described are recursive.
Actually, they almost never are. Iterative algorithms are almost
always used to avoid a stack explosion. However, the terminology is
still
On Fri, 27 May 2011 20:02:39 -0500, harrismh777 wrote:
> But the true picture is that 3.x is (way better) and completely
> incompatible with 2.x. Lying about this isn't helpful to anyone coming
> on board with Python. Just tell them the truth...
Take your own advice and stop accusing others of
On Friday, May 27, 2011 6:47:21 AM UTC-7, Roy Smith wrote:
> In article <948l8n...@mid.individual.net>,
> Gregory Ewing wrote:
>
> > John Bokma wrote:
> >
> > > A Perl programmer will call this line noise:
> > >
> > > double_word_re = re.compile(r"\b(?P\w+)\s+(?P=word)(?!\w)",
> > >
Am 28.05.2011 01:57 schrieb sturlamolden:
Yes. And opposite: CPython cannot know that builtin super() is not
called,
even if it does not see the name 'super'. I can easily make foo()
alias super().
Another alternative would have been to make use of __xxx magic.
If every class had an "automati
Am 27.05.2011 17:52 schrieb Steven D'Aprano:
On Fri, 27 May 2011 09:40:53 -0500, harrismh777 wrote:
3.x is completely incompatible with 2.x (some call it a dialect,
but that is a lie).
"Completely incompatible"? A "lie"?
Hard word, but it is true. Many things can and will fall on your feet
On 26/05/2011 6:00 PM, Wilbert Berendsen wrote:
Op donderdag 26 mei 2011 schreef Mark:
Wilbert wrote:
can anybody find out why the install script is not run?
Works for me in the pywin32 install script - maybe you should make the
smallest possible example that doesn't work and post the entir
> So I'd like to know: how do these other implementations handle concurrency
> matters for their primitive types, and prevent them from getting corrupted
> in multithreaded programs (if they do) ? I'm not only thinking about python
> types, but also primitive containers and types used in .Net and J
On Friday, May 27, 2011 3:19:22 PM UTC-7, Albert Hopkins wrote:
> On Fri, 2011-05-27 at 14:25 -0700, suresh wrote:
> > Hi,
> > I want to execute the following command line stuff from inside python.
> > $cd directory
> > $./executable
> >
> > I tried the following but I get errors
> > import subpr
On Fri, May 27, 2011 at 7:40 AM, harrismh777 wrote:
> Colin J. Williams wrote:
>
>> It would be safer to stick with Python 2.7 initially and then consider
>> the transition to 3.2 later.
>>
>
> I must disagree with Colin's statement. If you are a complete beginner with
> Python... then there is go
harrismh777 wrote:
Chris Angelico wrote:
To say that "most" 2.x code is
incompatible with 3.x is to deny the 2to3 utility,
all I'm
saying is that 3.x is not compatible with 2.x code (completely not
compatible)
and you're ignoring
the people who deliberately write code that can cross-execu
Chris Angelico wrote:
To say that "most" 2.x code is
incompatible with 3.x is to deny the 2to3 utility,
Oh, yes absolutely. Please don't misunderstand... anyone... I'm not
saying that code cannot be migrated... migration can usually occur
between incompatible releases and and between langu
On 27 Mai, 18:06, Steven D'Aprano wrote:
> Why? The fault is not that super is a function, or that you monkey-
> patched it, or that you used a private function to do that monkey-
> patching. The fault was that you made a common, but silly, mistake when
> reasoning about type(self) inside a class
On 27 Mai, 23:49, Stefan Behnel wrote:
> I think Sturla is referring to the "compile time" bit. CPython cannot know
> that the builtin super() will be called at runtime, even if it sees a
> "super()" function call.
Yes. And opposite: CPython cannot know that builtin super() is not
called,
even i
On Fri, 2011-05-27 at 15:05 +, Duncan Booth wrote:
> sturlamolden wrote:
> > I really don't like the Python 2 syntax of super, as it violates
> > the DRY principle: Why do I need to write super(type(self),self)
> > when super() will do? Assuming that 'self' will always be named
> > 'self' in m
On Sat, May 28, 2011 at 6:40 AM, harrismh777 wrote:
> Most 2.x code *will not* run correctly in 3.x/ Most of the best
> improvements and enhancements of 3.x will not back-port to below 2.7, and
> almost none of them will back-port before 2.6 (class decorations, for
> instance).
What's with the "
* suresh (Fri, 27 May 2011 14:25:52 -0700 (PDT))
> I want to execute the following command line stuff from inside python.
> $cd directory
> $./executable
>
> I tried the following but I get errors
> import subprocess
> subprocess.check_call('cd dir_name;./executable')
>
> Due to filename path is
On Fri, 2011-05-27 at 14:25 -0700, suresh wrote:
> Hi,
> I want to execute the following command line stuff from inside python.
> $cd directory
> $./executable
>
> I tried the following but I get errors
> import subprocess
> subprocess.check_call('cd dir_name;./executable')
>
> Due to filename p
Each command will be run in a distinct subprocess. A CWD is typically local
to a given subprocess. So after the first command/subprocess exits, your
cd's change is no longer there.
Try doing it in one command, with the two original commands separated by a
semicolon.
On Fri, May 27, 2011 at 2:25
I suspect the larger issue is that Multiple Inheritance is complex, but
folks don't appreciate that. Ask anyone about meta-classes and their
eyes bug-out, but MI? Simple! NOT.
On the other hand, perhaps the docs should declare that the built-in
objects are not designed for MI, so that that,
Steven D'Aprano, 27.05.2011 18:06:
On Fri, 27 May 2011 08:31:40 -0700, sturlamolden wrote:
On 27 Mai, 17:05, Duncan Booth wrote:
Oops. There's a reason why Python 2 requires you to be explicit about
the class; you simply cannot work it out automatically at run time.
Python 3 fixes this by wo
Hi,
I want to execute the following command line stuff from inside python.
$cd directory
$./executable
I tried the following but I get errors
import subprocess
subprocess.check_call('cd dir_name;./executable')
Due to filename path issues, I cannot try this version.
subprocess.check_call('./dir_n
Lew Schwartz wrote:
So, if I read between the lines correctly, you recommend Python 3? Does
the windows version install with a development environment?
Dabo, last I checked, uses wxPython, which uses wxWidgets (sp?), which
is not yet ported to Python 3. So if you got that route you'll need to
On 5/27/2011 11:46 AM, Chris Angelico wrote:
On Sat, May 28, 2011 at 4:31 AM, Ian Kelly wrote:
It seems to me that the example of combining built-in dictionary
classes is naively optimistic.
So... Can anyone offer a non-trivial example of multiple inheritance
that *doesn't* have pitfalls? F
Steven D'Aprano wrote:
Would you care to revise your claims?
No.
You have erected a straw-man... once again.
Most 2.x code *will not* run correctly in 3.x/ Most of the best
improvements and enhancements of 3.x will not back-port to below 2.7,
and almost none of them will back-port before
Hi,
> type test.py
import sys
sys.tracebacklimit = 0
import doesnotexist
> python test.py
ImportError: No module named doesnotexist
> python3 test.py
Traceback (most recent call last):
File "test.py", line 4, in
import doesnotexist
ImportError: No module named doesnotexist
The 3.2 docum
On 05/27/2011 03:47 PM, Roy Smith wrote:
In article<948l8nf33...@mid.individual.net>,
Gregory Ewing wrote:
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)
One of the tru
This is exactly what I want to do - I can then pick up various
elements of the list and turn them into floats, ints, etc. I have not
ever used decode, and will look it up in the docs to better understand
it. I can't thank everyone enough for the generous serving of help and
guidance - I certainly w
On Sat, May 28, 2011 at 4:31 AM, Ian Kelly wrote:
> It seems to me that the example of combining built-in dictionary
> classes is naively optimistic.
So... Can anyone offer a non-trivial example of multiple inheritance
that *doesn't* have pitfalls? From what I've seen, MI always seems to
require
Prasad, Ramit wrote:
I have to say, I do like Python's lack of keywords for these things
I thought True/False were among the list of keywords in Python 3.x ? Or are
those the only keywords?
http://docs.python.org/py3k/reference/lexical_analysis.html#keywords
False class finally
On behalf of the Python development team and the Python community, I'm
happy to announce the release of Python 2.5.6. There were no changes
since the release candidate.
This is a source-only release that only includes security fixes. The
last full bug-fix release of Python 2.5 was Python 2.5.4. Us
On Sat, May 28, 2011 at 4:10 AM, Prasad, Ramit
wrote:
>>>We also, though, need *real* URLs. Blind URLs through obfuscation
>>>services have their uses, but surely not in a forum like this. The real
>>>URL is http://news.ycombinator.com/item?id=2588262>.
>
> I remember reading a news article where
On Thu, May 26, 2011 at 10:31 AM, Raymond Hettinger wrote:
> I just posted a tutorial and how-to guide for making effective use of
> super().
I posted this already on the HackerNews thread but it seems to have
largely gone unnoticed, so I'm reposting it here.
It seems to me that the example of c
>(Did I *really* write that code? It has my name on it.)
Damn those ninja programmers who stole your name and coded something!
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone: 713 - 216 - 5423
This communication
- Original Message -
From: "Ethan Furman"
To:
Sent: Friday, May 27, 2011 11:14 AM
Subject: Re: The worth of comments
Miki Tebeka wrote:
https://docs.google.com/present/view?id=ah82mvnssv5d_162dbgx78gw ;)
+1
That was hilarious.
~Ethan~
--
http://mail.python.org/mailman/listinfo
>>We also, though, need *real* URLs. Blind URLs through obfuscation
>>services have their uses, but surely not in a forum like this. The real
>>URL is http://news.ycombinator.com/item?id=2588262>.
I remember reading a news article where a man was arrested (or was it fired)
for pornography because
Miki Tebeka wrote:
https://docs.google.com/present/view?id=ah82mvnssv5d_162dbgx78gw ;)
+1
That was hilarious.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
>I have to say, I do like Python's lack of keywords for these things
I thought True/False were among the list of keywords in Python 3.x ? Or are
those the only keywords?
Ramit
Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
712 Main Street | Houston, TX 77002
work phone
On Fri, May 27, 2011 at 4:37 AM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Fri, 27 May 2011 18:49:52 +1000, Ben Finney wrote:
>
> > Raymond Hettinger writes:
> >
> >> Hope you enjoyed the post.
> >
> > I certainly did.
> >
> > But I'm not better enlightened on why ‘super
On 2011-05-27, Irmen de Jong wrote:
> On 27-05-11 15:54, Grant Edwards wrote:
>> On 2011-05-27, Ben Finney wrote:
>>> 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
>
On 2011-05-27, Miki Tebeka wrote:
> https://docs.google.com/present/view?id=ah82mvnssv5d_162dbgx78gw ;)
I just realized that Usenet is sort of like radio.
After hearing/reading somebody for years, I don't seem to have a
detailed image of them in my head, but when I finally do see a picture
of
Duncan Booth wrote:
Steven D'Aprano wrote:
I was thrilled to learn a new trick, popping keyword arguments before
calling super, and wondered why I hadn't thought of that myself. How on
earth did I fail to realise that a kwarg dict was mutable and therefore
you can remove keyword args, or inj
On 27-05-11 15:54, Grant Edwards wrote:
On 2011-05-27, Ben Finney wrote:
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, mere
Ethan Furman wrote:
Any reason this is not a bug?
Looks like someone else beat me to filing:
http://bugs.python.org/issue11828
Looks like they fixed it as well.
~Ethan~
--
http://mail.python.org/mailman/listinfo/python-list
Thorsten Kampe wrote:
* Steven D'Aprano (27 May 2011 03:07:30 GMT)
Okay, I've stayed silent while people criticize me long enough. What
exactly did I say that was impolite?
Nothing.
John threw down a distinct challenge:
if Python is really so much better than Python [sic]
readabil
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 enough to want to
> maintain my code). But I neve
On 27/05/2011 10:27, Nick Coghlan wrote:
On Fri, May 27, 2011 at 6:46 PM, Stephen J. Turnbull wrote:
> What method is invoked to convert the numbers to text? What encoding
> is used to convert those numbers to text? How does this operation
> avoid also converting the *bytes* object to
On Fri, 27 May 2011 08:31:40 -0700, sturlamolden wrote:
> On 27 Mai, 17:05, Duncan Booth wrote:
>
>> Oops. There's a reason why Python 2 requires you to be explicit about
>> the class; you simply cannot work it out automatically at run time.
>> Python 3 fixes this by working it out at compile ti
On 27/05/2011 07:34, Tim Roberts wrote:
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."
Much like the Zen of Python.
--
http://mail.python.
https://docs.google.com/present/view?id=ah82mvnssv5d_162dbgx78gw ;)
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 27 May 2011 09:40:53 -0500, harrismh777 wrote:
> 3.x is completely incompatible with 2.x (some call it a dialect,
> but that is a lie).
"Completely incompatible"? A "lie"?
import math
import random
my_list = [3, 5, 7, 9]
n = random.choice(my_list)
if n%3:
func = math.sin
else:
On 27 Mai, 17:05, Duncan Booth wrote:
> Oops. There's a reason why Python 2 requires you to be explicit about
> the class; you simply cannot work it out automatically at run time.
> Python 3 fixes this by working it out at compile time, but for Python 2
> there is no way around it.
Then it shoul
On 27 Mai, 17:05, Duncan Booth wrote:
> >>> class C(B): pass
> >>> C().foo()
>
> ... infinite recursion follows ...
That's true :(
--
http://mail.python.org/mailman/listinfo/python-list
On 27 Mai, 16:27, sturlamolden wrote:
> Assuming that 'self' will always be named
> 'self' in my code, I tend to patch __builtins__.super like this:
>
> import sys
> def super():
> self = sys._getframe().f_back.f_locals['self']
> return __builtins__.super(type(self),self)
A monkey-patch
Steven D'Aprano wrote:
Python causes trouble by letting the users get at the internals, but
> things like this make it worthwhile.
Only if by "worthwhile" you mean "buggy as hell".
I *don't* believe this... the king of metaphors and bogus analogies
has come up with 'buggy as hell' !!?
sturlamolden wrote:
> On 26 Mai, 18:31, Raymond Hettinger wrote:
>> 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"
>>
>> T
The fact that even experienced programmers fail to see that
super(type(self),self) in Python 2 is NOT equivalent to super()
in Python 3 is telling something.
--
http://mail.python.org/mailman/listinfo/python-list
On Fri, 27 May 2011 10:33:20 -0400, Mel wrote:
> sturlamolden wrote:
>
>> I really don't like the Python 2 syntax of super, as it violates the
>> DRY principle: Why do I need to write super(type(self),self) when
>> super() will do? Assuming that 'self' will always be named 'self' in my
>> code, I
Colin J. Williams wrote:
It would be safer to stick with Python 2.7 initially and then consider
the transition to 3.2 later.
I must disagree with Colin's statement. If you are a complete beginner
with Python... then there is going to a learning curve for you... and
that curve should be 3.2---
Paul Rubin wrote:
Haskell probably has the most vibrant development community at
the moment but its learning curve is quite steep, and it has
various shortcomings some of which are being worked on but others
of which may be insurmountable.
Yes. You might want to lurk on:
http://lambda-the-u
sturlamolden wrote:
> I really don't like the Python 2 syntax of super, as it violates
> the DRY principle: Why do I need to write super(type(self),self)
> when super() will do? Assuming that 'self' will always be named
> 'self' in my code, I tend to patch __builtins__.super like this:
>
> import
Steven D'Aprano wrote:
You really do
need to know whether the car you drive uses leaded or unleaded.
Actually, you need to know whether your car can burn 85 gas (at
about 60 cents /gallon cheaper... and, whether 85 gas will have enough
energy to move the car without using 35% more fuel...
On 26 Mai, 18:31, Raymond Hettinger wrote:
> 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://
On 2011-05-27, Ben Finney wrote:
> 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've seen pl
In article ,
Stefan Behnel wrote:
> 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: sl
In article <948l8nf33...@mid.individual.net>,
Gregory Ewing wrote:
> 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)
One of the truly awesome things about th
In article ,
Chris Angelico wrote:
> (Did I *really* write that code? It has my name on it.)
Most version control systems have an annotate command which lets you see
who wrote a given line of code. Some of them are even honest enough to
call the command "blame" instead of "annotate" :-)
On Fri, 27 May 2011 00:02:23 -0700
Tim Roberts wrote:
> Ruby has a lot of followers, and I am trying to get excited about it, but
> it has succumbed to the same special-characters-as-syntax disease that
> killed Perl. Much Ruby code is just unreadable.
What? The recent Perl flame war wasn't eno
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 None rather than nothing for end.
If you'r
Steven D'Aprano wrote:
> I was thrilled to learn a new trick, popping keyword arguments before
> calling super, and wondered why I hadn't thought of that myself. How on
> earth did I fail to realise that a kwarg dict was mutable and therefore
> you can remove keyword args, or inject new ones i
On Fri, 27 May 2011 18:49:52 +1000, Ben Finney wrote:
> Raymond Hettinger writes:
>
>> Hope you enjoyed the post.
>
> I certainly did.
>
> But I'm not better enlightened on why ‘super’ is a good thing.
Perhaps Raymond assumed that by now everybody knows that multiple
inheritance in Python t
Carl Banks wrote:
> The end parameter looks pretty useless for
> .startswith() and is probably only present for consistency with other
> string search methods like .index().
No, the end parameter could be useful if the slice ends up shorter than the
prefix string:
>>> 'abcd'.startswith('abc',
On Fri, 27 May 2011 10:10:55 +0200, Thorsten Kampe wrote:
> * Steven D'Aprano (27 May 2011 03:07:30 GMT)
[...]
>> If I got it wrong about John, oh well, I said it was a guess, and
>> trying to get inside someone else's head is always a chancy business.
>
> Why were you trying to speculate in resp
On 2011.05.26 10:02 AM, Thomas Heller wrote:
> On Windows, you can use ctypes.FormatError(code) to map error codes
> to strings:
>
> >>> import ctypes
> >>> ctypes.FormatError(32)
> 'Der Prozess kann nicht auf die Datei zugreifen, da sie von einem
> anderen Prozess verwendet wird.'
> >>>
>
> Fo
On Friday, May 27, 2011 10:49:52 AM UTC+2, Ben Finney wrote:
> The exquisite care that you describe programmers needing to maintain is IMO
> just as much a deterrent as the super-is-harmful essay.
Worth quoting. Also I think this article may encourage naive programmers along
the dark path of coop
Raymond Hettinger writes:
> Hope you enjoyed the post.
I certainly did.
But I'm not better enlightened on why ‘super’ is a good thing. The
exquisite care that you describe programmers needing to maintain is IMO
just as much a deterrent as the super-is-harmful essay.
--
\“If you c
* Steven D'Aprano (27 May 2011 03:07:30 GMT)
> Okay, I've stayed silent while people criticize me long enough. What
> exactly did I say that was impolite?
Nothing.
> John threw down a distinct challenge:
>
> if Python is really so much better than Python [sic]
> readability wise, why
On May 26, 6:39 pm, Ben Finney wrote:
> We also, though, need *real* URLs. Blind URLs through obfuscation
> services have their uses, but surely not in a forum like this. The real
> URL is http://news.ycombinator.com/item?id=2588262>.
Fair enough. I had copied the link from Jesse's tweet (where
On Fri, May 27, 2011 at 12:45 PM, Ned Deily wrote:
>
> The discussion in http://bugs.python.org/issue4434 might be of some help.
Thanks Ned! That was most helpful. I'm still not sure exactly what I
changed, but between building with --enable-shared and some fiddling
with how I link my program, I'
Roy Smith wrote:
>
>Over the years, my use of comments has evolved. I was taught, "You
>should comment your code". Eventually, I came to realize that the real
>mandate is, "You should make it easy to understand your code". Comments
>are just one possible tool to help achieve that goal.
Abso
83 matches
Mail list logo