Re: doctest with variable return value

2006-07-25 Thread Rob Sinclar
response = urllib2.urlopen(request) STR = response.read() return STR.split(',')[1].strip() SYMB='AUDEUR' print SYMB,'=',get_rate(SYMB) Python rocks. That's be nice to indicate hour though (4th array element)... Best Regards, Rob Sinclar -- http://mail.python.org/mailman/listinfo/python-list

Re: Which Pyton Book For Newbies?

2006-07-26 Thread Rob Sinclar
On Tuesday 25 July 2006 04:33, [EMAIL PROTECTED] wrote: > > Web programming is all about stdin & stdout. Recommanded practice > > before going further. > > It's actually a little more (at least as far as CGI is concerned)...it > bears some level of abstraction, namely, a decent CGI lib. Do you mea

Re: HELP!!! How do I send an ACK packet in UDP?????

2006-07-26 Thread Rob Sinclar
On Wednesday 26 July 2006 00:48, [EMAIL PROTECTED] wrote: > how do I send an ack packet UDP stands for User Datagram Protocol. Ther'es no ack like in TCP. Define your own protocol ie when machine1 sends the string "ACK", machine2 has the acknowledge it wanted. Reg

Re: How do you implement this Python idiom in C++

2006-07-27 Thread Rob Williscroft
d< CountedClass2< void > >. Ofcouse the next problem is that CRTP-derivation above isn't real derivation, this idom translation clearly has a breaking point. If this is more than idle curiosity I strongly suggest you post a version of the python code you need to translate to C++. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: import question on wx ?

2006-07-27 Thread Rob Williscroft
ersion by running the following bit of python import sys print sys.version For example I currently get: running: python ...\test-1.py 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] from my homebrew (wxPython) editor. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python

Re: WSAStartup failed: error code 10107

2006-07-28 Thread Rob Wolfe
_socket > ImportError: WSAStartup failed: error code 10107 I'm not sure if that helps but check if you have multiple winsock.dll files on the machine. Maybe in the system path you have some old winsock.dll. regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: WSAStartup failed: error code 10107

2006-07-28 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Thanks for the suggestion Rob. All I can find are 2 copies of > winsock.dll: > c:/WINNT/system32/winsock.dll > c:/WINNT/system32/dllcache/winsock.dll > They're both the same version 3.10.0.13 > > I assume it's ok to have a copy in the d

Re: problem with regex

2006-07-28 Thread Rob Wolfe
that i have matching > parenthesis. You should use raw string: re.compile(r'[A-Za-z]:\\([^/:\*\?"<>\|])*') Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: problem with regex

2006-07-28 Thread Rob Wolfe
'c:\\test?:/') > <_sre.SRE_Match object at 0x009D7720> > >>> > > the last example shouldnt give a match If you want to learn RE I suggest to use great tool redemo.py (tk app). Then you can play with regular expressions to find the result you are looking for. It can be found in Python 2.4 in Tools\Scripts. Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: War chest for writing web apps in Python?

2006-07-28 Thread Rob Sinclar
clic 15 times on "ok" and I'm done. On the other hand aptitude is the worst thing ever for dependencies and that kind of stuff. Best Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: War chest for writing web apps in Python?

2006-07-29 Thread Rob Sinclar
aged with aptitude, not apt. Windows is definitely worth the effort. Best Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: War chest for writing web apps in Python?

2006-07-29 Thread Rob Sinclar
users working on linux machines without X server installed. Synaptic is the interface which leads the underlying application. Synaptic is often installed with a $ aptitude install synaptic Best Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: import a user created python file as module

2006-07-30 Thread Rob Wolfe
> How and what should I do to import file1.py into file1-dir1.py ? Please > give me some references to the tutorial topic which I can study as > well. And some reference: http://docs.python.org/tut/node8.html Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Newbie help - test for data type

2006-07-31 Thread Rob Wolfe
s) ... for dptcd in selecteddeptcodes: print dptcd ... >>> f(['aaa', 'bbb']) aaa bbb >>> f(['aaa']) aaa >>> f('aaa') aaa >>> f(None) >>> Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Python open a named pipe == hanging?

2006-08-03 Thread Rob Williscroft
_fifo', os.O_RDONLY ) though I'm using windows now, so can't test it. > print x > > > I know I could use a tempfile instead of a fifo in this very > simple case, I just want to know is there a standard way of > handling fifos withing python. See also os.pipe() Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Trouble displaying image with tkinter

2006-08-06 Thread Rob Williscroft
ing a parent reference in there (self in this case) i.e.: canvas = Canvas(self, width=300,height=200) but when I tested it it didn't seem to matter. I'd guess however that when the layout gets more complex it will make a difference. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: import help

2006-08-07 Thread Rob Wolfe
Error: name 'test' is not defined >>> import sys >>> sys.modules["-test"].fun2() 'Hello from -test !' Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: do people really complain about significant whitespace?

2006-08-09 Thread Rob Wolfe
"$Revision: 4.63 $" Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Advice on a TCP passthru daemon for HTTP proxy rotation

2006-08-10 Thread Rob Wolfe
uot;), then all data which gets > read from c1 is written to c2 - all data read from c2 is written to c1. > I'm pretty sure there's an elegant way to do this but I was wondering if > anyone had any input? I've tried GIYF'ing this but it's difficult to > search for

Re: sys.platform documentation?

2006-08-10 Thread Rob Wolfe
Michiel Sikma wrote: > So here's the question of the day: what does your sys.platform tell > you? :-) uname -srv HP-UX B.11.00 D python -c "import sys; print sys.platform" hp-ux11 Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: do people really complain about significant whitespace?

2006-08-10 Thread Rob Wolfe
Slawomir Nowaczyk wrote: > On Wed, 09 Aug 2006 07:33:41 -0700 > Rob Wolfe <[EMAIL PROTECTED]> wrote: > > #> Slawomir Nowaczyk wrote: > #> > #> > Really, typing brace after function/if/etc should add newlines and > #> > indent code as required -

Re: using python to edit a word file?

2006-08-10 Thread Rob Wolfe
to do is search in the Word document for certain > strings and either delete them or replace them. Easy enough, if only I > knew which function, etc. to use. > > Hope someone can push me in the right direction. Maybe this will be helpful: http://aspn.activestate.com/ASPN/Cookbook

Re: hide python code !

2006-08-11 Thread Rob Wolfe
John Machin wrote: > If you want to distribute obfuscated code, consider writing it in perl > :-) LOL That's really strong protection. Machine code is too easy to reverse engineer. :) Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Documenting a package with Pydoc

2006-08-18 Thread Rob Cowie
eds. Am I doing something wrong? Cheers, Rob C -- http://mail.python.org/mailman/listinfo/python-list

Re: Type conversion?

2006-08-18 Thread Rob Cowie
KraftDiner wrote: > I have the following code... > > import array > len32 = array.array('L') > len16 = array.array('H') > > len32.append(0) > len16.append(0) > > y = len32[0] > print y.__class__ > > z = len16[0] > print z.__class__ > > > how can I change Zs type to long? z_long = long(z) type(z

Re: Documenting a package with Pydoc

2006-08-19 Thread Rob Cowie
Anyone? -- http://mail.python.org/mailman/listinfo/python-list

Re: sending values over classes

2006-08-19 Thread Rob Wolfe
e import statement is what you're looking for. You can import a class from another module (file) to current module (file) and use it. BTW on pl.comp.lang.python you can meet helpful people too :) -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Documenting a package with Pydoc

2006-08-19 Thread Rob Cowie
Gabriel Genellina wrote: > At Friday 18/8/2006 11:45, Rob Cowie wrote: > > >Pydoc seems to be capable of writing documentation for all modules > >within a package by simply pointing it to the package on the command > >line... > > > >pydoc -w > > >

Re: Create a Multilanguage PDF in Python

2006-08-20 Thread Rob Wolfe
s from reportlab.pdfbase.ttfonts import TTFont from reportlab.pdfgen import canvas pdfmetrics.registerFont(TTFont('Verdana', 'Verdana.ttf')) c = canvas.Canvas("pl.pdf") c.setFont("Verdana", 12) c.drawString(100, 600, "Witaj, świecie!".decode("is

Re: Create a Multilanguage PDF in Python

2006-08-21 Thread Rob Wolfe
tware with MySql. In my Hosting is present > the Python support but I don't thing that the MySQLdb is present. How > can I solve this little problem? You can install MySQLdb wherever you want. You need only to make sure the module is in your PYTHONPATH. HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression question

2006-08-21 Thread Rob Wolfe
findall returns > john, tall > joe, short > > Ideas? Have you tried this: 'tag1.+?name="(.+?)".*?(?=tag2).*?="adj__(.*?)__' ? HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression question

2006-08-21 Thread Rob Wolfe
e like this: 'tag1.+?name="(.+?)".*?(?:<)(?=tag2).*?="adj__(.*?)__' HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular Expression question

2006-08-21 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > got zero results on this one :) Really? >>> s = ''' ''' >>> pat = re.compile('tag1.+?name="(.+?)".*?(?:<)(?=tag2).*?="adj__(.*?)__', >>> re.DOTALL) >>> m = re.find

Re: Create a Multilanguage PDF in Python

2006-08-23 Thread Rob Wolfe
here: http://docs.python.org/tut/node8.html#SECTION00811 HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: How to ask sax for the file encoding

2006-10-04 Thread Rob Wolfe
lass MyParser(object): def XmlDecl(self, version, encoding, standalone): print "XmlDecl", version, encoding, standalone def Parse(self, data): Parser = expat.ParserCreate() Parser.XmlDeclHandler = self.XmlDecl Parser.Parse(data, 1)

Re: Where is Python in the scheme of things?

2006-10-04 Thread Rob Knapp
On Wed, 2006-10-04 at 16:21 -0400, gord wrote: > What is particularly disappointing is the absence of a Windows IDE, > components and an event driven paradigm. How does Python stand relative to > the big 3, namely Visual C++, Visual Basic and Delphi? I realize that these > programming packages

RE: file system iteration

2006-10-09 Thread Rob Williscroft
) )) ## if you need the constants ... for i, name in DRIVE_TYPE_MAP.iteritems(): exec( "%s = %d" %( name, i) ) GetDriveTypeW = ctypes.windll.kernel32.GetDriveTypeW for i in range( ord( 'A' ), 1 + ord('Z') ): path = u"%c:\\" % chr( i ) print path, DRIVE_TYPE_MAP[ GetDriveTypeW( path ) ] Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: A curses-game I need help with.

2006-10-09 Thread Rob Wolfe
key_command == ord('9'): > player.move('upright') > > elif key_command == ord('1'): > player.move('downleft') > > elif key_command == ord('3'): > player.move('downright') > > elif key_command == ord('Q'): ## Exit > break > > elif key_command == ord('5'): ## Wait > pass > > elif key_command == ord('x'): ## print location > game.msg.iMsg("X: " + str(player.loc['x']) + ", Y: " + > str(player.loc['y'])) > > elif key_command == ord('z'): > strlist = "" > for i in game.walls: > strlist = strlist + str(i) + " " > game.msg.iMsg(strlist) > > elif key_command == ord('c'): > for count in range(0,2): > game.mainwin.move(count,0) > game.mainwin.clrtoeol() > > else: > game.msg.iMsg("That is not a valid command.") > > if len(game.msg.msgs) == 0: # If there are any msgs. > game.mainwin.refresh() > else: > game.msg.updateMsg() > > game.msg.ereasMsg() # I've moved this line # game.msg.eraseMsg > > > if __name__ == "__main__": > try: > import psyco > psyco.full() > except ImportError: > # Don't use something that doesn't exists. > pass > > main() > > curses.nocbreak(); game.mainwin.keypad(0); curses.echo() > curses.endwin() > > > (The code is GPL'ed, Martin Ahnelöv 06) > -- HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Using Gnutar to remove a list of files

2006-10-10 Thread Rob Williscroft
t; only returns 0. Is there any way to make it return a list, or to copy > the information over? Thanks in advance! > Perhaps this will help: http://docs.python.org/lib/tar-examples.html Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send E-mail without an external SMTP server ?

2006-10-15 Thread Rob Wolfe
'm not an expert,so I need some examples > to learn how to use it. See standard documentation: http://docs.python.org/lib/SMTP-example.html HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: How to send E-mail without an external SMTP server ?

2006-10-16 Thread Rob Wolfe
[EMAIL PROTECTED] wrote: > Do I have to setup a smtp server on my localhost ? If I see correctly your smtp server is gmail.com. HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: Convert StringIO to string

2006-10-16 Thread Rob Williscroft
o I guess I > need to convert it to a string first, can someone please advise how I > can do this? > How strange, you are already "converting" to a string in the return line (the call to the getvalue() method), so: scripter = scripter.getvalue().replace("<"

Re: Strange Behavior

2006-10-16 Thread Rob Williscroft
abcd wrote in news:[EMAIL PROTECTED] in comp.lang.python: > class Foo: > def __init__(self, name, data=[]): http://docs.python.org/ref/function.html#l2h-619 Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Looking for assignement operator

2006-10-17 Thread Rob Wolfe
Alexander Eisenhuth wrote: > Hello, > > is there a assignement operator, that i can overwrite? You can't overwrite assignment operator, but you can overwrite methods of numeric objects: http://docs.python.org/ref/numeric-types.html HTH, Rob -- http://mail.python.org/mailman/l

Re: a little about regex

2006-10-18 Thread Rob Wolfe
ookbehind deny = re.compile(r'.*\.com\.my(>|$)') cnt = 0 if deny.search(adr): cnt += 1 if allow.search(adr): cnt += 1 return cnt HTH, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: a little about regex

2006-10-19 Thread Rob Wolfe
side the stream. I thing that is not a normal > regex input. It's only python valid. Am I right? The sequence inside "(?...)" is an extension notation specific to python. Regards, Rob -- http://mail.python.org/mailman/listinfo/python-list

Re: forcing a definition to be called on attribute change

2006-10-24 Thread Rob Williscroft
atures and tries to adapt features or idiom's from other languages. I guess we could claim that one-liners are unpythonic (because indentation is a language feature), but claiming a all PEP 8 violating styles are unpyhonic seems to me to be devaluing the term. Rob. -- http://www.victim-prime

Re: Where do nested functions live?

2006-10-30 Thread Rob Williscroft
pe = namespace() scope.inner() In short I think an "outer" keyword (or whatever it gets called) will just add another way of doing something I can already do, and potentially makes further refactoring harder. Thats -2 import-this points already. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How can I import a script with an arbitrary name ?

2006-10-30 Thread Rob Williscroft
+ '.py' > import filename > > So, I have a module with an arbitrary file name and I want to load it, > and later access its function definitions. > How can I do this ? In my example, the last line will obviously not > work. > http://docs.python.org/lib/built-

Re: Calling GNU/make from a Python Script

2006-10-30 Thread Rob Williscroft
http://docs.python.org/lib/node529.html and call: http://docs.python.org/lib/node530.html you will need to use the "cwd" argument. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Where do nested functions live?

2006-10-31 Thread Rob Williscroft
Frederic Rentsch wrote in news:mailman.1536.1162292996.11739.python- [EMAIL PROTECTED] in comp.lang.python: > Rob Williscroft wrote: >> Frederic Rentsch wrote in news:mailman.1428.1162113628.11739.python- >> [EMAIL PROTECTED] in comp.lang.python: >> >> >> d

Re: Where do nested functions live?

2006-11-01 Thread Rob Williscroft
Frederic Rentsch wrote in news:mailman.1556.1162316571.11739.python- [EMAIL PROTECTED] in comp.lang.python: > Rob Williscroft wrote: >> Frederic Rentsch wrote in news:mailman.1536.1162292996.11739.python- >>> Rob Williscroft wrote: >>>> Frederic Rentsch wrote in news

Re: Style for modules with lots of constants

2006-11-01 Thread Rob Williscroft
ut you can cut down on some of the cruft: class Constants( object ): pass Constants.RIGHT = 0 Constants.LEFT = 1 ## client code ... print Constants.LEFT Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Style for modules with lots of constants

2006-11-01 Thread Rob Williscroft
rtcut for importing lots and lots of constant definitions. I > expect I will want to define some more constants for other parts of > pyparsing, and the instance scoping helps organize them, that's all. Again I'm struggling to see how using an instance is any differe

Re: Where do nested functions live?

2006-11-01 Thread Rob Williscroft
object itself? Because you hadn't yet pointed this out to me :-). Thanks Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Style for modules with lots of constants

2006-11-01 Thread Rob Williscroft
and then accidentally call > > paragraph.align(gboc.LEFT) > > when you mean > > paragraph.align(gboc.ALIGN_LEFT) > > This is what I understand the grandparent's post to be referring > to by "descriptive context". Fair enough, but there is noth

Re: Where do nested functions live?

2006-11-01 Thread Rob Williscroft
rse, > either might give you problems in the case of a recursive inner > function. What problems would it have that a recursive global function that modified a global object, or a recursive method that modified its instance doesn't have ? Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Tools for Java/Python scripting

2006-11-03 Thread Rob Williscroft
Java" might be better. Pythoning-ly yr's Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: How to get/read Hard disk label / drive label

2006-11-05 Thread Rob Williscroft
p://docs.python.org/dev/lib/module-ctypes.html which is built in to python 2.5 Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: UnboundLocalError

2006-11-09 Thread Rob Williscroft
;-). Seriously I'd bet (if I were a gambling man) that this is by design, not either of "too much work for the interpreter" or "nobody's submitted a patch". IOW: Why should the intepreter do more work just so the user can find new and interesting ways to sh

Re: odd problem with watsup and VB6 application with modal dialog

2006-11-11 Thread Rob Williscroft
#x27;Open') print 'clicking button to open dialog...' post_clickButton(button) sleep( 0.5 ) form=findTopWindow(wantedText='Dialog_Form') button=findControl(form,wantedText='Close') print "clicking close button" post_clickButton(button) main() Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter: select multiple entries in Listbox widget?

2006-06-01 Thread Rob Williscroft
nd the answer here: http://www.python.org/doc/life-preserver/ClassListbox.html Though I had to guess the `= "multiple"` part. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: how to define a static field of a given class

2006-06-02 Thread Rob Williscroft
ing like staticfield() ) > can anyone help me on this? > thanks very much for your help :) > What you possibly want is just a class attribute: class MyClass( object ): static_field = 10 myInstance = MyClass() print MyClass.static_field, myInstance.static_fiel

Re: beginner code problem

2006-06-02 Thread Rob Johnson
I had messed up and trying to fix it. The code I posted was just running but never stopping to give the the output. Thanks for explaining about getting a new value for flip, I wasn't positive about that and you really helped clear up any confusion I was having. Rob > > This can&

Re: Making a second window with Tkinter

2006-06-03 Thread Rob Williscroft
) You made the buttons command option None (which is what showdeck() returns), you need to make command a function that calls showdeck(list('zxcvbnm')). L = Button(root, text="Show Deck", font="Courier", command= lambda : showdeck(list('zxcvbnm'))) > L.p

Most elegant way to generate 3-char sequence

2006-06-09 Thread Rob Cowie
Hi all, I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', 'abb', 'abc' etc. all the way to 'zzz'. How would you construct a generator to acheive this? A simple, working but somewhat inelegant solution is... alpha = ['a','b','c','d'] #shortened for brevity alpha2 = ['a','b'

Re: Most elegant way to generate 3-char sequence

2006-06-10 Thread Rob Cowie
John Machin wrote: > On 10/06/2006 7:49 AM, Rob Cowie wrote: > > Hi all, > > > > I wish to generate a sequence of the form 'aaa', 'aab', aac' 'aba', > > 'abb', 'abc' etc. all the way to 'zzz'. > &g

Re: What is Expressiveness in a Computer Language

2006-06-14 Thread Rob Thorpe
Torben Ægidius Mogensen wrote: > On a similar note, is a statically typed langauge more or less > expressive than a dynamically typed language? Some would say less, as > you can write programs in a dynamically typed language that you can't > compile in a statically typed language (without a lot of

Re: Which compiler will Python 2.5 / Windows (Intel) be built with?

2006-06-15 Thread Rob Williscroft
spx?familyId=9b3a2ca6-3647- 4070-9f41-a333c6b9181d&displayLang=en&oRef= I found the link with google: net 1.1 sdk download its the first hit. *) I'm not going to check as I have VS2003 installed already. Rob. -- http://www.victim-prime.dsl.pipex.com/ -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-16 Thread Rob Thorpe
Torben Ægidius Mogensen wrote: > Pascal Costanza <[EMAIL PROTECTED]> writes: > > > Torben Ægidius Mogensen wrote: > > > > > On a similar note, is a statically typed langauge more or less > > > expressive than a dynamically typed language? Some would say less, as > > > you can write programs in a d

ANN: updated release of PyDSTool dynamical systems package (version 0.83.2 patch #1)

2006-06-16 Thread Rob Clewley
s for your attention,Rob Clewley, Erik Sherwood, Drew LaMar,Dept. of Mathematics and Center for Applied Mathematics, Cornell University. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Rob Thorpe
Torben Ægidius Mogensen wrote: > "Rob Thorpe" <[EMAIL PROTECTED]> writes: > > > Torben Ægidius Mogensen wrote: > > > > That's the point: Bugs that in dynamically typed languages would > > > require testing to find are found by the compiler

Re: What is Expressiveness in a Computer Language

2006-06-19 Thread Rob Thorpe
Chris Smith wrote: > Torben Ægidius Mogensen <[EMAIL PROTECTED]> wrote: > > That's not really the difference between static and dynamic typing. > > Static typing means that there exist a typing at compile-time that > > guarantess against run-time type violations. Dynamic typing means > > that such

Calling every method of an object from __init__

2006-06-19 Thread Rob Cowie
oking for a mechanism to avoid this. class Foo(object): def __init__(self): #call all methods here def test(self): print 'The test method' def hello(self): print 'Hello user' Thanks, Rob C -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Chris Smith wrote: > Rob Thorpe <[EMAIL PROTECTED]> wrote: > > A language is latently typed if a value has a property - called it's > > type - attached to it, and given it's type it can only represent values > > defined by a certain class. > > I'

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Andreas Rossberg wrote: > Rob Thorpe wrote: > > > > No, that isn't what I said. What I said was: > > "A language is latently typed if a value has a property - called it's > > type - attached to it, and given it's type it can only represent value

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Andreas Rossberg wrote: > Rob Thorpe wrote: > >> > >>>No, that isn't what I said. What I said was: > >>>"A language is latently typed if a value has a property - called it's > >>>type - attached to it, and given it's type it can

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Ketil Malde wrote: > "Rob Thorpe" <[EMAIL PROTECTED]> writes: > > > But it only gaurantees this because the variables themselves have a > > type, the values themselves do not. > > I think statements like this are confusing, because there are > differe

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Matthias Blume wrote: > "Rob Thorpe" <[EMAIL PROTECTED]> writes: > > Andreas Rossberg wrote: > >> Rob Thorpe wrote: > >> >> > >> >>>No, that isn't what I said. What I said was: > >> >>>"A language is

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Andreas Rossberg wrote: > Rob Thorpe wrote: > >Andreas Rossberg wrote: > >>Rob Thorpe wrote: > >> > >>>>>"A language is latently typed if a value has a property - called it's > >>>>>type - attached to it, and given

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Darren New wrote: > Rob Thorpe wrote: > > The compiler > > relys entirely on the types of the variables to know how to correctly > > operate on the values. The values themselves have no type information > > associated with them. > > int x = (int) (20.5 / 3); >

Re: What is Expressiveness in a Computer Language

2006-06-20 Thread Rob Thorpe
Pascal Costanza wrote: > Matthias Blume wrote: > > Pascal Costanza <[EMAIL PROTECTED]> writes: > >> (slot-value p 'address) is an attempt to access the field 'address in > >> the object p. In many languages, the notation for this is p.address. > >> > >> Although the class definition for person does

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Matthias Blume wrote: > "Rob Thorpe" <[EMAIL PROTECTED]> writes: > > > I think we're discussing this at cross-purposes. In a language like C > > or another statically typed language there is no information passed > > with values indicating their type.

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
> So, will y'all just switch from using "dynamically typed" to "latently > typed", and stop talking about any real programs in real programming > languages as being "untyped" or "type-free", unless you really are > talking about situations in which human reasoning doesn't come into > play? I think

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Matthias Blume wrote: > "Rob Thorpe" <[EMAIL PROTECTED]> writes: > > Matthias Blume wrote: > >> "Rob Thorpe" <[EMAIL PROTECTED]> writes: > >> > >> > I think we're discussing this at cross-purposes. In a language like

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Matthias Blume wrote: > "Rob Thorpe" <[EMAIL PROTECTED]> writes: > > >> >> > No it doesn't. Casting reinterprets a value of one type as a value of > >> >> > another type. > >> >> > There is a difference. If I cast

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
David Hopwood wrote: > Rob Thorpe wrote: > > Matthias Blume wrote: > >>"Rob Thorpe" <[EMAIL PROTECTED]> writes: > >> > >>>I think we're discussing this at cross-purposes. In a language like C > >>>or another statically t

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Rob Thorpe wrote: > Chris Smith wrote: > > Torben Ægidius Mogensen <[EMAIL PROTECTED]> wrote: > > > That's not really the difference between static and dynamic typing. > > > Static typing means that there exist a typing at compile-time that > > &

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Vesa Karvonen wrote: > In comp.lang.functional Anton van Straaten <[EMAIL PROTECTED]> wrote: > > Let me add another complex subtlety, then: the above description misses > > an important point, which is that *automated* type checking is not the > > whole story. I.e. that compile time/runtime distin

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Thorpe
Dr.Ruud wrote: > Marshall schreef: > > > "dynamic types." I don't have a firm definition for > > that term, but my working model is runtime type tags. In which > > case, I would say that among statically typed languages, > > Java does have dynamic types, but C does not. C++ is > > somewhere in the

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Warnock
Rob Thorpe <[EMAIL PROTECTED]> wrote: +--- | > So, will y'all just switch from using "dynamically typed" to "latently | > typed", and stop talking about any real programs in real programming | > languages as being "untyped" or &q

Re: What is Expressiveness in a Computer Language

2006-06-21 Thread Rob Warnock
I can look at it or perform TYPE-OF on it or TYPECASE or something and thereby discover its actual type at the moment[1], whereas "manifest" means that types[2] are lexically apparent in the code. -Rob [1] I added "at the moment", since I remembered that in Common Lisp on

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Rob Thorpe
Dr.Ruud wrote: > Rob Thorpe schreef: > > Dr.Ruud: > >> Marshall: > > >>> "dynamic types." I don't have a firm definition for > >>> that term, but my working model is runtime type tags. In which > >>> case, I would say that amo

Re: What is Expressiveness in a Computer Language

2006-06-22 Thread Rob Thorpe
David Hopwood wrote: > Rob Thorpe wrote: > > Vesa Karvonen wrote: > > > >>In comp.lang.functional Anton van Straaten <[EMAIL PROTECTED]> wrote: > >> > >>>Let me add another complex subtlety, then: the above description misses > >>>an

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Rob Thorpe
David Hopwood wrote: > Rob Thorpe wrote: > > David Hopwood wrote: > > > >>As far as I can tell, the people who advocate using "typed" and "untyped" > >>in this way are people who just want to be able to discuss all languages in > &g

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Rob Thorpe
Dr.Ruud wrote: > Rob Thorpe schreef: > > > I would suggest that at least assembly should be referred to as > > "untyped". > > There are many different languages under the umbrella of "assembly", so > your suggestion is bound to be false. Well yes,

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Rob Thorpe
Andreas Rossberg wrote: > Rob Thorpe wrote: > > > > Its easy to create a reasonable framework. > > Luca Cardelli has given the most convincing one in his seminal tutorial > "Type Systems", where he identifies "typed" and "safe" as two

Re: What is Expressiveness in a Computer Language

2006-06-23 Thread Rob Thorpe
[EMAIL PROTECTED] wrote: > Rob Thorpe wrote: > > > > But it differs from latently typed languages like python, perl or lisp. > > In such a language there is no information about the type the variable > > stores. The programmer cannot write code to test it, and so can

Re: Web Browser Pygame Plug-in?

2006-07-07 Thread Rob Knapp
On Thu, 2006-07-06 at 14:24 -0400, Gregory Piñero wrote: > Hi guys, > > I was just idley curious on what it would take to make a web plug-in > for Pygame. I'm picturing it working the way my browser currently > shows flash games. Is such an idea even possible? Has anyone > attempted this? > A

Re: how can I avoid abusing lists?

2006-07-07 Thread Rob Cowie
;> 1 print coutners[4] >>> 1 The increment function should probably include a try:...except: statement to catch KeyErrors that would arise if you passed a value that is not a key in the counters dictionary. Rob C -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   9   10   >