a common approach is to embed python in a compiled binary
On Thu, Feb 3, 2011 at 9:18 PM, Steven D'Aprano wrote:
> Alan Gauld wrote:
>>
>> "C.Y. Ruhulessin" wrote
>>
>>> When I load up Civilization IV, a Firaxis game, the loading screen tells
>>> me
>>> "Loading Python".
>>>
>>> However, I can't
"David Goering" wrote
It says v3 is Under Construction, how long do you expect it to be
like this.
The basic v3 tutor is all done except for the Case Study - which is
currently about 75% complete. Its certainly usable.
The Practical Python topics have not been started yet, but any v3 user
wh
"Alex Hall" wrote
I am wondering what the best way to do the following would be: throw
an exception, or always return an object but set an error flag if
something goes wrong? Here is an example:
Throw an exception is the short general case answer...
class c:
def __init__(self):
self.error=
Karim wrote:
> Recall:
>
> >>> re.subn(r'([^\\])?"', r'\1\\"', expression)
>
> Traceback (most recent call last):
> File "", line 1, in
> File "/home/karim/build/python/install/lib/python2.7/re.py", line
> 162, in subn
>return _compile(pattern, flags).subn(repl, string, count)
Karim wrote:
> That is not the thing I want. I want to escape any " which are not
> already escaped.
> The sed regex '/\([^\\]\)\?"/\1\\"/g' is exactly what I need (I have
> made regex on unix since 15 years).
Can the backslash be escaped, too? If so I don't think your regex does what
you think
On 2/4/11, Alan Gauld wrote:
> "Alex Hall" wrote
>
>> I am wondering what the best way to do the following would be: throw
>> an exception, or always return an object but set an error flag if
>> something goes wrong? Here is an example:
>
> Throw an exception is the short general case answer...
>
On Feb 4, 2011, at 8:03 AM, Alex Hall wrote:
> On 2/4/11, Alan Gauld wrote:
>> "Alex Hall" wrote
>>
>>> I am wondering what the best way to do the following would be: throw
>>> an exception, or always return an object but set an error flag if
>>> something goes wrong? Here is an example:
>>
>
> > And most methods do not return the object of which they
> > are a part (in Python at least, in SmallTalk they do).
> That seems like it would get rather confusing...
Actually, from an OOP point of view, its a very powerful
default and I wish more Python methods did it. It allows
you to c
On 2/4/2011 5:35 AM Bill Felton said...
Um, not quite correct -- methods *without a specified return value* always
return self, that is, the object which executed the method.
Um, no. They return None.
>>> class Test:
... def __init__(self):pass
... def test(self):pass
...
>>> a=Test().t
Um, yes, emphatically yes. You missed the context, which was Smalltalk, and it
is terms of Smalltalk that my reply is couched.
Yes, Python returns None.
Smalltalk returns self by default.
Given the dropped context, you are correct.
Given the context meant, I am.
regards,
Bill
On Feb 4, 2011, at
On 2/4/11, Bill Felton wrote:
> Um, yes, emphatically yes. You missed the context, which was Smalltalk, and
> it is terms of Smalltalk that my reply is couched.
> Yes, Python returns None.
> Smalltalk returns self by default.
> Given the dropped context, you are correct.
> Given the context meant
Smalltalk is an OO programming language that had some dominance in the late
80's through much of the 90s. It has proceeded to more or less commit suicide
through a variety of mechanisms.
By 'drop' I meant 'drop the context of the remarks', which in the original post
was discussing Smalltalk's d
I see, thanks!
On 2/4/11, Bill Felton wrote:
> Smalltalk is an OO programming language that had some dominance in the late
> 80's through much of the 90s. It has proceeded to more or less commit
> suicide through a variety of mechanisms.
> By 'drop' I meant 'drop the context of the remarks', whi
On 02/04/2011 02:36 AM, Steven D'Aprano wrote:
Karim wrote:
*Indeed what's the matter with RE module!?*
You should really fix the problem with your email program first;
Thunderbird issue with bold type (appears as stars) but I don't know
how to fix it yet.
A man when to a doctor and said, "
On 02/04/2011 11:26 AM, Peter Otten wrote:
Karim wrote:
That is not the thing I want. I want to escape any " which are not
already escaped.
The sed regex '/\([^\\]\)\?"/\1\\"/g' is exactly what I need (I have
made regex on unix since 15 years).
Can the backslash be escaped, too? If so I don't
By the way with your helper function algorithm Steven and Peter comments
you made me think of this change:
karim@Requiem4Dream:~$ echo 'prima " "' | sed -e
's/""/\\"\\"/g;s/\([^\]\)"/\1\\"/g'
prima \" \"
karim@Requiem4Dream:~$ echo 'prima ""' | sed -e
's/""/\\"\\"/g;s/\([^\]\)"/\1\\"/g'
pr
16 matches
Mail list logo