On Apr 11, 8:09 am, Paul McGuire wrote:
> On Apr 11, 2:41 am, Aaron Brady wrote:
>
>
>
> > Why do I get the feeling that the authors of 'pyparsing' are out of
> > breath?
>
> What kind of breathlessness do you mean? I'm still breathing, last
> time I checked.
>
> The-rumors-of-my-demise-have-bee
On Apr 11, 2:41 am, Aaron Brady wrote:
>
> Why do I get the feeling that the authors of 'pyparsing' are out of
> breath?
>
What kind of breathlessness do you mean? I'm still breathing, last
time I checked.
The-rumors-of-my-demise-have-been-greatly-exaggerated'ly yours,
-- Paul
--
http://mail.
On Sat, 11 Apr 2009 11:03:16 +0200, Joel Hedlund wrote:
> Peter Otten wrote:
>> But what you're planning to do seems more like
>>
> def is_it_safe(source):
>> ... return "_" not in source
>> ...
> source = "getattr(42, '\\x5f\\x5fclass\\x5f\\x5f')" if
> is_it_safe(source):
>> ...
On Apr 11, 3:18 am, Joel Hedlund wrote:
> Aaron Brady wrote:
> > Would you be willing to examine a syntax tree to determine if there
> > are any class accesses?
>
> Sure? How do I do that? I've never done that type of thing before so I
> can't really say if it would work or not.
>
> /Joel
NO PROM
Peter Otten wrote:
Joel Hedlund wrote:
Peter Otten wrote:
def is_it_safe(source):
return "_" not in source and r'\' not in source
"".join(map(chr, [95, 95, 110, 111, 95, 95]))
'__no__'
But you don't have access to neither map or chr?
/Joel
'5f5f7374696c6c5f6e6f745f736166655f5f'.dec
Joel Hedlund wrote:
> Peter Otten wrote:
>>> def is_it_safe(source):
>>> return "_" not in source and r'\' not in source
>>
> "".join(map(chr, [95, 95, 110, 111, 95, 95]))
>> '__no__'
>
> But you don't have access to neither map or chr?
>
> /Joel
>>> '5f5f7374696c6c5f6e6f745f736166655
Peter Otten wrote:
def is_it_safe(source):
return "_" not in source and r'\' not in source
"".join(map(chr, [95, 95, 110, 111, 95, 95]))
'__no__'
But you don't have access to neither map or chr?
/Joel
--
http://mail.python.org/mailman/listinfo/python-list
Joel Hedlund wrote:
> Peter Otten wrote:
>> But what you're planning to do seems more like
>>
> def is_it_safe(source):
>> ... return "_" not in source
>> ...
> source = "getattr(42, '\\x5f\\x5fclass\\x5f\\x5f')"
> if is_it_safe(source):
>> ... print eval(source)
>> ...
>>
>
Peter Otten wrote:
But what you're planning to do seems more like
def is_it_safe(source):
... return "_" not in source
...
source = "getattr(42, '\\x5f\\x5fclass\\x5f\\x5f')"
if is_it_safe(source):
... print eval(source)
...
Bah. You are completely right of course.
Just as a thou
Joel Hedlund wrote:
> Matt Nordhoff wrote:
> '\x5f'
>> '_'
> getattr(42, '\x5f\x5fclass\x5f\x5f') # __class__
>>
>>
>> Is that enough to show you the error of your ways?
>
> No, because
>
> >>> print '_' in '\x5f\x5fclass\x5f\x5f'
> True
But what you're planning to do seems more like
Matt Nordhoff wrote:
'\x5f'
'_'
getattr(42, '\x5f\x5fclass\x5f\x5f') # __class__
Is that enough to show you the error of your ways?
No, because
>>> print '_' in '\x5f\x5fclass\x5f\x5f'
True
:-D Cuz seriously, it's a bad idea.
Yes probably, but that's not why. :-)
(BTW: What if a use
Matt Nordhoff wrote:
'\x5f'
'_'
getattr(42, '\x5f\x5fclass\x5f\x5f') # __class__
Is that enough to show you the error of your ways?
No, because
>>> print '_' in '\x5f\x5fclass\x5f\x5f'
True
:-D Cuz seriously, it's a bad idea.
Yes probably, but that's not why. :-)
(BTW: What if a use
Aaron Brady wrote:
Would you be willing to examine a syntax tree to determine if there
are any class accesses?
Sure? How do I do that? I've never done that type of thing before so I
can't really say if it would work or not.
/Joel
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 10, 7:54 pm, Steven D'Aprano wrote:
> On Thu, 09 Apr 2009 13:13:50 -0400, Terry Reedy wrote:
> > Joel Hedlund wrote:
> >> Hi all!
>
> >> I'm writing a program that presents a lot of numbers to the user, and I
> >> want to let the user apply moderately simple arithmentics to these
> >> numbe
On Thu, 09 Apr 2009 13:13:50 -0400, Terry Reedy wrote:
> Joel Hedlund wrote:
>> Hi all!
>>
>> I'm writing a program that presents a lot of numbers to the user, and I
>> want to let the user apply moderately simple arithmentics to these
>> numbers. One possibility that comes to mind is to use the
how about sympy? http://code.google.com/p/sympy/
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 9, 10:56 am, Joel Hedlund wrote:
> Hi all!
>
> I'm writing a program that presents a lot of numbers to the user, and I
> want to let the user apply moderately simple arithmentics to these
> numbers.
Joel -
Take a look at the examples page on the pyparsing wiki (http://
pyparsing.wikispace
Joel Hedlund wrote:
Hi all!
I'm writing a program that presents a lot of numbers to the user, and I
want to let the user apply moderately simple arithmentics to these
numbers. One possibility that comes to mind is to use the eval function,
but since that sends up all kinds of warning flags in
On Apr 9, 10:56 am, Joel Hedlund wrote:
> Hi all!
>
> I'm writing a program that presents a lot of numbers to the user, and I
> want to let the user apply moderately simple arithmentics to these
> numbers. One possibility that comes to mind is to use the eval function,
> but since that sends up al
Joel Hedlund wrote:
> Hi all!
>
> I'm writing a program that presents a lot of numbers to the user, and I
> want to let the user apply moderately simple arithmentics to these
> numbers. One possibility that comes to mind is to use the eval function,
> but since that sends up all kinds of warning f
Hi all!
I'm writing a program that presents a lot of numbers to the user, and I
want to let the user apply moderately simple arithmentics to these
numbers. One possibility that comes to mind is to use the eval function,
but since that sends up all kinds of warning flags in my head, I thought
21 matches
Mail list logo