Decorators and static typing.

2005-01-05 Thread whisper
Well, the decorator war is over (Python lost IMO!) and now we've got the 
static typing war to fight!

Both of these seem like syntax sugar to avoid writing good code! One has 
already introduced ugly coding and the 2nd is likely to do the same!

Ok, so how do you do keywords and default values?
def myFunc(a=1: int, b="hi": string, people=[]: array[person]): int:
   yadda
   yadda
   yadda
So, what is the int or string? the default value or the label? (Of 
course it's obvious to an experienced programmer - is that the intened 
audience for Python now and the python in education initiative dead?). 
The last parameter is particularly arcane (and ugly!).

If this mistake looking for a place to happen has to happen, at least 
put the type before the horse!:
def myFunc(int a=1, string b="hi" array[person] people) int: #note lack 
of first : after "("
   yadda
   yadda
   yadda

Of course, one could not change the language at all!:
def myFunc(a, b):
   assert(type(a) == "int")
   assert(type(b) == "string")
   #aggrigates lose here - how do you check the type of every element? 
(ensure that array[person].__add__ makes sure the rhs is of type person 
so the problem never comes up in the first place!)
   yadda
   yadda
   yadda
I know: this doesn't save you from yourself when calling myFunc from 
somewhere else, but it does ensure that parameters are of the expected 
type where it really counts! (People who need saiving from themselves 
ought not to be programmers in the first place!)

Of course, decorators might have been done this last way too - with 
predefined functions and no needed changes to the language, but maybe 
that's not as cool for the dev guys. That brings up the larger problem, 
as alluded to by the "python evolution: unease" thread: the dev guys 
seem intent on more breadth without focusing on the depth of the language!

At some point, someone has to decide that python is feature complete!
Lua is looking better and better! ;=)
--
http://mail.python.org/mailman/listinfo/python-list


Need Python web hosting ASAP

2005-06-21 Thread whisper
Medium/small site with mod_python and sqllite or mySQL running Python 
2.3.3 or later on Apache 2.x.

I can do the python and CGI, but might need a _little_ hand holding for 
the rest.

Will also need SSL and a certificate.

Also mailboxes for ~12 people (to start). We don't do unsolicited 
mailings or expect a huge amount of mail traffic at this time.

Will need a domain name transfered.

NEED TO GET THIS UP ASAP!

Low cost is best.

David LeBlanc
Seattle, WA USA
-- 
http://mail.python.org/mailman/listinfo/python-list


Secure email

2005-08-03 Thread whisper
I need to write a .cgi that will take the content of an https GET or 
POST and send it securely as email to an Outlook client.

I think that OpenSSL is somewhere in this, but I'm not even sure how to 
create the right certificate, how to use it to encrypt mail and how to 
install a certificate in Outlook (>= 2000).

Code snippets and pointers to tutorials greatly appreciated. I've got a 
week to deploy this!

Thanks!

Dave LeBlanc
Seattle, WA USA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Secure email

2005-08-03 Thread whisper
Paul Rubin wrote:

>[EMAIL PROTECTED] writes:
>  
>
>>I need to write a .cgi that will take the content of an https GET or
>>POST and send it securely as email to an Outlook client.
>>
>>
>
>You're asking how to make S/MIME messages?  This isn't really the
>right newsgroup.
>  
>
Well, perhaps it bears saying explicitly that I want to use python and 
python libraries to write the .cgi script.

If there's a better newsgroup, would you please tell me?

Dave LeBlanc
Seattle, WA USA
-- 
http://mail.python.org/mailman/listinfo/python-list