Re: A rather unpythonic way of doing things

2005-10-01 Thread Tom Anderson
On Thu, 29 Sep 2005, Peter Corbett wrote:

> One of my friends has recently taken up Python, and was griping a bit 
> about the language (it's too "prescriptive" for his tastes). In 
> particular, he didn't like the way that Python expressions were a bit 
> crippled. So I delved a bit into the language, and found some sources of 
> syntactic sugar that I could use, and this is the result:
>
> http://www.pick.ucam.org/~ptc24/yvfc.html

It's this sort of thing that makes it clear beyond all shadow of a doubt 
that Cambridge should be razed to the ground.

Keep up the good work.

tom

-- 
I'm not quite sure how that works but I like it ...
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Simon Brunning
On 9/29/05, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> "fraca7" wrote:
>
> > print ''.join(map(lambda x: chrord(x) - ord('a')) + 13) % 26) + 
> > ord('a')), 'yvfc'))
>
> that's spelled
>
> print "yvfc".decode("rot-13")
>
> or, if you prefer,
>
> print "yvfc".encode("rot-13")
>
> , in contemporary python.

I'm not sure that being more comprehensible is considered a virtue in
this thread, /F. ;-)

--
Cheers,
Simon B,
[EMAIL PROTECTED],
http://www.brunningonline.net/simon/blog/
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Fredrik Lundh
"fraca7" wrote:

> print ''.join(map(lambda x: chrord(x) - ord('a')) + 13) % 26) + 
> ord('a')), 'yvfc'))

that's spelled

print "yvfc".decode("rot-13")

or, if you prefer,

print "yvfc".encode("rot-13")

, in contemporary python.

 



-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Rocco Moretti
fraca7 wrote:
> Richie Hindle a écrit :
> 
>> [Peter]
>>
>>> http://www.pick.ucam.org/~ptc24/yvfc.html
>>
>>
>>
>> [Jeff]
>>
>>> Yuma Valley Agricultural Center?
>>> Yaak Valley Forest Council?
>>
>>
>>
>> I went through the same process.  My guess is "Yes, Very F'ing Clever."
>> Peter?
>>
> 
> print ''.join(map(lambda x: chrord(x) - ord('a')) + 13) % 26) + 
> ord('a')), 'yvfc'))

Less pythonic:

__import__('sys').stdout.write(''.join(map(lambda x: chrord(x) - 
ord('a')) + 13) % 26) + ord('a')), 'yvfc'))

More Pythonic:

print 'yvfc'.decode('rot13')
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Richie Hindle

[Peter]
> http://www.pick.ucam.org/~ptc24/yvfc.html

[fraca7]
> print ''.join(map(lambda x: chrord(x) - ord('a')) + 13) % 26) + 
> ord('a')), 'yvfc'))

Ah!  Or more easily, Edit / Apply ROT13.  Thanks!

-- 
Richie Hindle
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Cyril Bazin
"Crypthonic" could be the exact word...On 29 Sep 2005 15:19:11 +0100, Peter Corbett <[EMAIL PROTECTED]
> wrote:Richie Hindle <[EMAIL PROTECTED]
> writes:>> [Peter]> > http://www.pick.ucam.org/~ptc24/yvfc.html>> [Jeff]> > Yuma Valley Agricultural Center?
> > Yaak Valley Forest Council?>> I went through the same process.  My guess is "Yes, Very F'ing Clever."> Peter?You're all thinking about it the wrong way (he says, being cryptic).
Peter--A frightful hobgoblin is stalking throughout Europe. - The Communist Manifesto, 1st English Edition--http://mail.python.org/mailman/listinfo/python-list

-- 
http://mail.python.org/mailman/listinfo/python-list

Re: A rather unpythonic way of doing things

2005-09-29 Thread Jeff Schwab
fraca7 wrote:
> Richie Hindle a écrit :
> 
>> [Peter]
>>
>>> http://www.pick.ucam.org/~ptc24/yvfc.html
>>
>>
>>
>> [Jeff]
>>
>>> Yuma Valley Agricultural Center?
>>> Yaak Valley Forest Council?
>>
>>
>>
>> I went through the same process.  My guess is "Yes, Very F'ing Clever."
>> Peter?
>>
> 
> print ''.join(map(lambda x: chrord(x) - ord('a')) + 13) % 26) + 
> ord('a')), 'yvfc'))
> 
> :)

LOL.  Thank you!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread fraca7
Richie Hindle a écrit :
> [Peter]
> 
>>http://www.pick.ucam.org/~ptc24/yvfc.html
> 
> 
> [Jeff]
> 
>>Yuma Valley Agricultural Center?
>>Yaak Valley Forest Council?
> 
> 
> I went through the same process.  My guess is "Yes, Very F'ing Clever."
> Peter?
> 

print ''.join(map(lambda x: chrord(x) - ord('a')) + 13) % 26) + 
ord('a')), 'yvfc'))

:)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Michael Ekstrand
On Thursday 29 September 2005 04:53, Peter Corbett wrote:
> One of my friends has recently taken up Python, and was griping a bit
> about the language (it's too "prescriptive" for his tastes). In
> particular, he didn't like the way that Python expressions were a bit
> crippled. So I delved a bit into the language, and found some sources
> of syntactic sugar that I could use, and this is the result:
>
> http://www.pick.ucam.org/~ptc24/yvfc.html

Umm, TMTOWTDI? As uniform as Python is, it still is flexible...

Brilliant. Simply brilliant.

-Michael
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Peter Corbett
Richie Hindle <[EMAIL PROTECTED]> writes:
> 
> [Peter]
> > http://www.pick.ucam.org/~ptc24/yvfc.html
> 
> [Jeff]
> > Yuma Valley Agricultural Center?
> > Yaak Valley Forest Council?
> 
> I went through the same process.  My guess is "Yes, Very F'ing Clever."
> Peter?

You're all thinking about it the wrong way (he says, being cryptic).

Peter

-- 
A frightful hobgoblin is stalking throughout Europe.
 - The Communist Manifesto, 1st English Edition
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Richie Hindle

[Peter]
> http://www.pick.ucam.org/~ptc24/yvfc.html

[Jeff]
> Yuma Valley Agricultural Center?
> Yaak Valley Forest Council?

I went through the same process.  My guess is "Yes, Very F'ing Clever."
Peter?

-- 
Richie Hindle
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Jeff Schwab
Peter Corbett wrote:
> One of my friends has recently taken up Python, and was griping a bit
> about the language (it's too "prescriptive" for his tastes). In
> particular, he didn't like the way that Python expressions were a bit
> crippled. So I delved a bit into the language, and found some sources
> of syntactic sugar that I could use, and this is the result:
> 
> http://www.pick.ucam.org/~ptc24/yvfc.html

Yuma Valley Agricultural Center?
Yaak Valley Forest Council?
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Paul Rubin
Peter Corbett <[EMAIL PROTECTED]> writes:
> http://www.pick.ucam.org/~ptc24/yvfc.html
> 

Madness!  I love it.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: A rather unpythonic way of doing things

2005-09-29 Thread Richie Hindle

[Peter]
> http://www.pick.ucam.org/~ptc24/yvfc.html

Beautiful!  Greenspun's Tenth Rule[1] performed before your very eyes!  (Not
quite, because you started with Python so you were already half way there.
And yours probably isn't buggy.  8-)

[1] http://en.wikipedia.org/wiki/Greenspun's_Tenth_Rule

-- 
Richie Hindle
[EMAIL PROTECTED]
-- 
http://mail.python.org/mailman/listinfo/python-list