Re: dictionary interface

2005-10-05 Thread Paul Rubin
Antoon Pardon <[EMAIL PROTECTED]> writes: > But that is contradicted by the unittest. If you have a unittest for > comparing dictionaries, that means comparing dictionaries has a > testable characteristic and thus is further defined. No, I don't think so. The unittest makes sure that a particular

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > > Python already has a "global" declaration; > > Which is evaluated at runtime, does not require that the actual global > variable be pre-existing, and does not create the global variable if > not actually assigned. I think that is pretty different than

Re: dictionary interface

2005-10-05 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > I can't help wondering, though, under what conditions it actually > makes sense to compare two dictionaries for anything other than > equality. You might want to sort a bunch of dictionaries to bring the equal ones together. -- http://mail.python.org/mai

Re: dictionary interface

2005-10-05 Thread Paul Rubin
Antoon Pardon <[EMAIL PROTECTED]> writes: > My tree class is almost finished, but one unittest still fails, > is this a failing of my class (as a replacement for a dictionary) > or is this a non-required characteristic of dictionaries? If it were me, I'd treat the language reference manual as auth

Re: Quick help needed: how to format an integer ?

2005-10-05 Thread Paul Rubin
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > "10001234" -> ""10.001.234"" > So I need thousand separators. > Can anyone helps me with a simply solution (like %xxx) ? I think you're supposed to do a locale-specific conversion (I've never understood that stuff). You could also do something lik

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > Aren't you looking for some of compile-time checking that ensures that > only declared variables are actually used? If so, how does global help? You'd have to declare any variable global, or declare it local, or it could be a function name (defined with

Re: Does python support the expression "a = b | 1"???

2005-10-05 Thread Paul Rubin
Wenhua Zhao <[EMAIL PROTECTED]> writes: > Is there such expression in python? Not in the current version but one is being added. -- http://mail.python.org/mailman/listinfo/python-list

Re: "no variable or argument declarations are necessary."

2005-10-05 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > OK. The Python compiler would check that the name is declared but it > would not check that it is defined before use? So this would be > acceptable: > > def foo(): > local x > return x Come on, you are asking silly questions. Any reasonable C

Re: "no variable or argument declarations are necessary."

2005-10-06 Thread Paul Rubin
Duncan Booth <[EMAIL PROTECTED]> writes: > The value XML_NAMESPACE was imported from xml.dom, but the xml package is > kind of weird. XML_NAMESPACE defined both in xml.dom and in the > _xmlplus.dom package. The _xmlplus package is conditionally imported by the > xml package, and completely repla

Re: "no variable or argument declarations are necessary."

2005-10-06 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > I'm not trying to be silly. I am trying to get a handle on the > semantics that you are proposing. So we now have two requirements for > the new declaration syntax (please let me know if I'm wrong): > > o the variable must be declared > o the variable mu

Re: "no variable or argument declarations are necessary."

2005-10-06 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > Without a clear idea of the nature of the proposal, it is impossible > to assess it's costs and benefits. So could a proponent of optional > declarations please provide a more clear proposal? There is no proposal on the table. There's a discussion of ho

Re: "no variable or argument declarations are necessary."

2005-10-06 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > I think we're using different definitions of statically typed > here. A language that is statically typed doesn't *need* type > inferencing - the types are all declared! Type determines the thypes > by inferenceing them from an examination of the program.

Re: So far (about editing tools)

2005-10-06 Thread Paul Rubin
Micah Elliott <[EMAIL PROTECTED]> writes: > Furthermore, Eclipse requires java and is thusly not provided on any > linux distro I'm familiar with, which I consider a huge roadblock. And > as mentioned, it's bloated. It comes with Fedora Core 4 and is compiled with gcj. > I would suspect that the

Can't extend function type

2005-10-07 Thread Paul Rubin
Oh well. I had wanted to be able to define two functions f and g, and have f*g be the composition of f and g. >>> func_type = type(lambda: None) >>> class composable_function(func_type): ... def __mult__(f,g): ... def c(*args, **kw): ... return f(g(*args, **kw))

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > In other words, you want Python to be strongly-typed, but sometimes > you want to allow a reference to be to any object whatsoever. In which > case you can't possibly do any sensible type-checking on it, so this > new Python+ or whatever you want to call i

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Paul Rubin
Brian Quinlan <[EMAIL PROTECTED]> writes: > > There is no proposal on the table. There's a discussion of how this > > stuff can work, and whether it's useful. As for how the compiler > > deals with imported modules, see for example Common Lisp or Haskell or > > ML--how do they do it? > > Except

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > use assert as the soonest possible point. implementing "type gates" is > trivial, if you think you need them. What this is about (to me at least) is the edit-debug cycle. Let's say I write some Python code, using assert to validate datatypes. Maybe I

Re: Python recipes: list mixin, improved timeit, etc

2005-10-07 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > That looks great. Now, if only I understood mixins: what are they, and > what they are for, and in particular, how they differ from mere > subclassing. I'm not sure what you mean by "mere subclassing" so maybe there is no difference. Mixins are sort o

Re: Python recipes: list mixin, improved timeit, etc

2005-10-07 Thread Paul Rubin
"Michele Simionato" <[EMAIL PROTECTED]> writes: > Once in a time, I thought mixins where a good idea; now I don't think > so since they are too easily abused (see Zope 2) and as a consequence > you get spaghetti-inheritance, where you have objects with methods > inherited from everywhere. So be ver

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > - FPs share their own set of problems - try writing a server. The > have inherent troubles with event-driven programs. Erlang? > Still, FP is cool. But python too. And just attaching some > type-inference to python won't work. Yeah, I've figured

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > > Erlang? > > Guess what, worked with that, too :) And let me assure you - it does > have pretty much runtime type error issues. It's interpreted. Yes, it makes no attempt at being statically typed. It's like Python that way, AFAIK. > Easy cases

Re: Can't extend function type

2005-10-07 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > Well - function inheritance is not known so far in python - and in no > other language I know. Yeah, I didn't really expect it to work, but it seems like a logical consequence of type/class unification. > Basically you want __mult__ being part of f

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > When you want local variable in lisp you do : > > > > (let ((a 3)) (+ a 1)) > > Excep that's not a decleration, that's a binding. That's identical to > the Python fragment: > >a = 3 >return a + 1 > > except for the creation of the new sc

Re: Can't extend function type

2005-10-07 Thread Paul Rubin
"Michele Simionato" <[EMAIL PROTECTED]> writes: > If you google a bit on the newsgroup, you should find a message > from me asking about the ability to subclass FunctionType, and > a reply from Tim Peters saying that the only reason why this > was not done is lack of developer time and the fact tha

Re: socketServer questions

2005-10-07 Thread Paul Rubin
rbt <[EMAIL PROTECTED]> writes: > 1. Do I need to use threads to handle requests, if so, how would I > incorporate them? The clients are light and fast never sending more > than 270 bytes of data and never connecting for more than 10 seconds > at a time. There are currently 500 clients and potenti

Re: Objects with different data views

2005-10-07 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Anyone have any good ideas for how I should implement this? These days you can use properties. Before, you'd have had to do it manually with __setattr__ / __getattr__ methods. Here's how I'd do it with properties, if I have the math right. You're us

Re: Objects with different data views

2005-10-07 Thread Paul Rubin
Yeah, that's what I meant. Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: socketServer questions

2005-10-07 Thread Paul Rubin
rbt <[EMAIL PROTECTED]> writes: > The server just logs data, nothing else. It's not private or important > data... just sys admin type stuff (ip, mac addy, etc.). I just don't > want some script kiddie discovering it and trying to 'hack' it. By doing > so, they'd fill the log up with crap. So, If t

Re: noob question Letters in words?

2005-10-07 Thread Paul Rubin
"Ivan Shevanski" <[EMAIL PROTECTED]> writes: > choice1 = raw_input("> ") choice1 is now the whole string that the user types > Is there a way (I searched for a module but didnt find one) that I can > do something like this? > > if choice1 in ('1', 'S', 's'): > #do first option You'd use cho

Re: noob question Letters in words?

2005-10-07 Thread Paul Rubin
"Ivan Shevanski" <[EMAIL PROTECTED]> writes: > Alright, I'm going to stop trying to defend my idea since it's > obviously a bad one. What do you recommend? Just choose the options that you present carefully. If you have unsophisticated users and you want to be a bit fancier, put up a GUI so they

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > ap.py:4: No global (test) found > ap.py:5: Local variable (ego1d) not used > Helen:/tmp alex$ > > If you're so typo-prone and averse to unittests that you consider this > kind of issue to be a serious problem, just use pychecker and get > informed about

Re: Python's Performance

2005-10-08 Thread Paul Boddie
ructures, network access, database access, or any of the countless other things that go on in any non-trivial program"? That Python doesn't perform well executing loops involving mathematical operations? Or something about "research and development" in the big consulting houses? Pa

Re: socketServer questions

2005-10-08 Thread Paul Rubin
rbt <[EMAIL PROTECTED]> writes: > Off-topic here, but you've caused me to have a thought... Can hmac be > used on untrusted clients? Clients that may fall into the wrong hands? > How would one handle message verification when one cannot trust the > client? What is there besides hmac? Thanks, rbt I

Re: how do you pronounce wxpython

2005-10-08 Thread Paul Boddie
involved investigating this issue in more depth. Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-08 Thread Paul Boddie
at we're on the cutting edge (presumably before demanding a premium to "sort it all out"), many of the issues have been known about for a good while. Of course, that doesn't mean that the software industry is in any hurry to do anything about it. Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-10-08 Thread Paul Rubin
Lasse Vågsæther Karlsen <[EMAIL PROTECTED]> writes: > But trying to keep your email world into a pure text-based > no-formatting-whatsoever world, that's a fantasy bubble that is bound > to burst, sooner rather than later. I read mail over an ssh connection to a Unix shell. I have no easy way to

Re: Jargons of Info Tech industry

2005-10-08 Thread Paul Rubin
Mike Meyer <[EMAIL PROTECTED]> writes: > > I read mail over an ssh connection to a Unix shell. I have no easy > > way to read html email with a graphics browser. > > You don't need a grahics browser - you just need a browser. Right, precisely. I use lynx, as I explained. It renders the html as

Re: Function decorator that caches function results

2005-10-09 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > > def cache_function(fn): > > cache = {} > > def cached_result(*args, **kwargs): > > if args in cache: > > return cache[args] > > result = fn(*args, **kwargs) > > cache[args] = result > > return

Re: Jargons of Info Tech industry

2005-10-09 Thread Paul Rubin
Roedy Green <[EMAIL PROTECTED]> writes: > >I read mail over an ssh connection to a Unix shell. I have no easy > >way to read html email with a graphics browser. > > So the rest of the world should forgo rich communication because of > your obsolete software? How could anything every evolve with

Re: assigning in nested functions

2005-10-09 Thread Paul Rubin
jena <[EMAIL PROTECTED]> writes: > # BEGIN CODE > def test(): > def x(): > print a > a=2 # *** > a=1 > x() > print a > > test() > # END CODE > > This code fails (on statement print a in def x), if I omit line marked > ***, it works (it prints 1\n1\n). It look like when I assign var

Re: new forum -- homework help/chit chat/easy communication

2005-10-09 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > Tcl is an early example of a something that started as a "reusable > command language" and turned into a "real programming language" > along the way: Yes, that's why tcl is such an awful language. And it happens all the time. It's better to just star

Re: Jargons of Info Tech industry

2005-10-09 Thread Paul Rubin
Roedy Green <[EMAIL PROTECTED]> writes: > >His reply wasn't exactly clear, but I that he means that wen you use HTM > >mail, you don't have to attach the photo with the email. You can also > >use the HTML to refer to an image somewhere on a webserver. > There is that and also the use of HTML forma

Re: Function decorator that caches function results

2005-10-09 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > No. I'm obsessed with finding out what closures are, since nobody seems to > have a good definition of them! Why don't you read SICP: http://mitpress.mit.edu/sicp/full-text/book/book.html You will be a much wiser person for having done so. > Howe

Re: Function decorator that caches function results

2005-10-09 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Is it correct to say that Python *always* creates a closure whenever a def > or lambda is executed? Or is it only for *certain* defs/lambdas? The word closure is being used two different ways. First of all the computer-science term "closure" which mea

Re: Python reliability

2005-10-09 Thread Paul Rubin
Ville Voipio <[EMAIL PROTECTED]> writes: > The software should be running continously for > practically forever (at least a year without a reboot). > Is the Python interpreter (on Linux) stable and > leak-free enough to achieve this? I would say give the app the heaviest stress testing that you c

Re: Python reliability

2005-10-09 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > If performance is really not such an issue, would it really matter if you > periodically restarted Python? Starting Python takes a tiny amount of time: If you have to restart an application, every network peer connected to it loses its connection. Thi

Re: best Pythonic way to do this sort: Python newb

2005-10-09 Thread Paul Rubin
"Sean Berry" <[EMAIL PROTECTED]> writes: > myList = [[value1, value2, value3],[value1, value2, value3], ...] > > I have a function which takes value3 from the lists above and returns > another value. I want to use this returned value to sort the lists. > > So, my resultant list would be ordered

Re: best Pythonic way to do this sort: Python newb

2005-10-09 Thread Paul Rubin
"Sean Berry" <[EMAIL PROTECTED]> writes: > > def get_key(x): return x[2] > > sorted_list = sorted(myList, key=get_key) > > Sorry if I am missing something. But. what is sorted here? sorted is a built-in function that sorts the thing that you pass it. It just appeared in Python 2.4, I think. Wit

Re: Python reliability

2005-10-10 Thread Paul Rubin
Ville Voipio <[EMAIL PROTECTED]> writes: > Goes without saying. But I would like to be confident (or as > confident as possible) that all bugs are mine. If I use plain > C, I think this is the case. Of course, bad memory management > in the underlying platform will wreak havoc. I am planning to > u

Re: Python reliability

2005-10-10 Thread Paul Rubin
Ville Voipio <[EMAIL PROTECTED]> writes: > Just one thing: how reliable is the garbage collecting system? > Should I try to either not produce any garbage or try to clean > up manually? The GC is a simple, manually-updated reference counting system augmented with some extra contraption to resolve

Re: socketServer questions

2005-10-10 Thread Paul Rubin
rbt <[EMAIL PROTECTED]> writes: > > I don't understand the question. HMAC requires that both ends share a > > secret key; does that help? > > That's what I don't get. If both sides have the key... how can it be > 'secret'? All one would have to do is look at the code on any of the > clients and

Re: socketServer questions

2005-10-10 Thread Paul Rubin
rbt <[EMAIL PROTECTED]> writes: > > Instead, for client #i, let that client's key be something like > > hmac(your_big_secret, str(i)).digest() > > and the client would send #i as part of the string. > > How is this different from sending a pre-defined string from the client > that the server kno

Re: Send password over TCP connection

2005-10-10 Thread Paul Rubin
"dcrespo" <[EMAIL PROTECTED]> writes: > I have a program that serves client programs. The server has a login > password, which has to be used by each client for logging in. So, when > the client connects, it sends a string with a password, which is then > validated on the server side. The problem i

Learning Python

2005-10-10 Thread Paul DiRezze
encapsulation, inheritance and polymorphism are but I have very little experience in using them as I've written just a few Java programs (i.e., I guess I could use a primer in OO programming). Any ideas? paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Send password over TCP connection

2005-10-10 Thread Paul Rubin
"dcrespo" <[EMAIL PROTECTED]> writes: > Hi. I found TSL, a Python Library that supports SRP. > Do you know where can I find a sample client and server code? Thanks > for your help. I don't know about TSL, but TLSLite (www.trevp.net/tlslite) supports SRP. -- http://mail.python.org/mailman/listinfo

Re: Send password over TCP connection

2005-10-10 Thread Paul Rubin
"dcrespo" <[EMAIL PROTECTED]> writes: > 3. Both Client and Server creates a hash string from > > 4. Client sends the hash string to the server > 5. Server compares his hash result with the hash string received from > de client. > > I think it is a very good solution, Isn't it? No. It's vulnerabl

Re: Python's garbage collection was Re: Python reliability

2005-10-10 Thread Paul Rubin
Tom Anderson <[EMAIL PROTECTED]> writes: > Has anyone looked into using a real GC for python? I realise it would > be a lot more complexity in the interpreter itself, but it would be > faster, more reliable, and would reduce the complexity of extensions. The next PyPy sprint (this week I think) is

Re: Python's Performance

2005-10-10 Thread Paul Boddie
er virtual machine implementations, I wonder what happened to this one: http://effbot.org/zone/pytte.htm Fredrik? ;-) Paul [1] Theo F. de Ridder, "Enabling bare Python as universal connector for ad-hoc networks": http://www.python-in-business.org/ep2005/download.cpy?document=8912 (warn

Re: Send password over TCP connection

2005-10-10 Thread Paul Rubin
Dan Stromberg <[EMAIL PROTECTED]> writes: > > No. It's vulnerable to dictionary search. Use SRP if you can. > Where can I learn more about this? http://srp.stanford.edu as already mentioned. Also, RFC 2945 describes an older version (still ok). -- http://mail.python.org/mailman/listinfo/python-

Re: Function decorator that caches function results

2005-10-10 Thread Paul Rubin
Tom Anderson <[EMAIL PROTECTED]> writes: > Okay, a crack at a definition: a closure is a function in which some > of the variable names refer to variables outside the function. That's misleading, I'd say a closure is a combination of a function (executable code) and a lexical environment (the valu

Re: Batteries Included?

2005-10-11 Thread Paul Rubin
Sybren Stuvel <[EMAIL PROTECTED]> writes: > > I might be wrong expecting that a language whose moto is "Batteries > > Included" would be able to produce exe files. > > Indeed, you're wrong. Why would such an ability be included in Python? distutils.exe, included in Python, in fact does have the a

Re: Send password over TCP connection

2005-10-11 Thread Paul Rubin
Laszlo Zsolt Nagy <[EMAIL PROTECTED]> writes: > This is a bit offtopic here. I read the RFC and I do not see why SRP > is not vulnerable to dictionary attacks. > If I have a working client software then I can use it to reveal > passwords. Isn't it a dictionary attack? Dictionary attack in this con

Re: Learning Python

2005-10-11 Thread Paul Rubin
"Chris Dewin" <[EMAIL PROTECTED]> writes: > There was an excellent such primer on devshed, by Icarus, but they appear > to have taken it down. > > I saved a copy of it to my HD. Would there be anything morally, or legally > wrong with me uploading it to my site? A little googling shows it's still

Re: Batteries Included?

2005-10-11 Thread Paul Rubin
<[EMAIL PROTECTED]> writes: > Because you can't run it yourself? If you cannot run the > freshly-made exe yourself, why would you want to distrubute it, > without even trying? But if you can, then you can run the InnoSetup > as well. Obviously I'd want someone to test the .exe before putting it in

Re: How to do *args, **kwargs properly

2005-10-11 Thread Paul Rubin
Lasse Vågsæther Karlsen <[EMAIL PROTECTED]> writes: > or is the "proper python" way simply this: > > def fn(*values, **options): > if "cmp" in options: comparison = options["cmp"] > else: comparison = cmp > # rest of function here > > and thus ignoring the wrong parameter names? I

Re: Learning Python

2005-10-11 Thread Paul DiRezze
These are all great suggestions. Thanks to all who replied. paul -- http://mail.python.org/mailman/listinfo/python-list

Re: python interpreter

2005-10-11 Thread Paul Rubin
"g.franzkowiak" <[EMAIL PROTECTED]> writes: > Where can I find informations like this for Python ? "Use the force, read the source". Python's interpreter is more like a big switch statement on bytecodes, though. -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's garbage collection was Re: Python reliability

2005-10-11 Thread Paul Rubin
[EMAIL PROTECTED] (Alex Martelli) writes: > > Has anyone looked into using a real GC for python? ... > > lot more complexity in the interpreter itself, but it would be faster, > > more reliable, and would reduce the complexity of extensions. > > ??? It adds no complexity (it's already there), it'

Re: Nicer way of strip and replace?

2005-10-11 Thread Paul Rubin
Markus Rosenstihl <[EMAIL PROTECTED]> writes: > This looks ugly (I htink) and I wonder if there is a nicer way to > strip commata and change the comma to a dot already when reading in. > Or should i do it with a shell script before processing in python? First of all you should just set your local

Re: Nicer way of strip and replace?

2005-10-11 Thread Paul Rubin
Markus Rosenstihl <[EMAIL PROTECTED]> writes: > indeed, it did it correctly by default: > > read_file = csv.reader(open('2005_08_Rechnung_4963184011.dat', 'r'), > delimiter="\t") > for row in read_file: > rechnung.append(row) Oh cool. I think you could even say: rechnung = list(read_fi

Re: Jargons of Info Tech industry

2005-10-11 Thread Paul Rubin
Roedy Green <[EMAIL PROTECTED]> writes: > So let's say I decide to send an email to Donald Knuth. Good luck. Prof. Knuth stopped reading email years before there was a big spam problem. He uses his own version of hashcash to cut down on unimportant mail: if you want to write to him, you have to

Re: piping out binaries properly

2005-10-11 Thread Paul Rubin
Erik Max Francis <[EMAIL PROTECTED]> writes: > > I've written lots of things whose standard out was designed > > specifically to be read by another program, but never as binary data. > > Plenty of applications use that functionality and depend on it. See > cjpeg, djpeg, the pbmplus library, and s

Re: calling matlab

2005-10-12 Thread Paul McGuire
mcg/python/using_matlab_from_python.html. Best of luck, -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: piping out binaries properly

2005-10-12 Thread Paul Watson
"Andy Leszczynski" wrote in message news:[EMAIL PROTECTED] >I have got following program: > > import sys > import binascii > from string import * > sys.stdout.write(binascii.unhexlify("41410A4141")) > > > when I run under Unix I got: > > $ python u.py > u.bin > $ od -t x1 u.bin > 000 41 41 0a

Re: Jargons of Info Tech industry

2005-10-13 Thread Paul Rubin
Roedy Green <[EMAIL PROTECTED]> writes: > Next Mr. Phish had to present his passport etc when he got his Thawte > ID. Now Interpol has a much better handle on putting him in jail. > He can't repudiate his phishing attempt. Any underage drinker in a college town can tell you a hundred ways to get

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > AFAIK some LISPs do a similar trick to carry int values on > cons-cells. And by this tehy reduce integer precision to 28 bit or > something. Surely _not_ going to pass a regression test suite :) Lisps often use just one tag bit, to distinguish betwe

Re: installer for amd64 build of python?

2005-10-13 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Does anyone know of an available downloader for an amd64 bit > build of (a modern) python? I've gotten a bug report from someone using Python under Linux on an amd64, so compiling for 64 bits definitely is feasible. You could try the Fedora Core 4 amd64 distro (http://

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > That particular implementation used 3 or 4 tag-bits. Of course you are > right that nowadays python won't notice the difference, as larger nums > get implicitely converted to a suitable representation. But then the > efficiency goes away... Basically

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > (fwiw, switching to tagging in CPython would break most about > everything. might as well start over, and nobody's likely to do > that to speed up integer- dominated programs a little...) Yeah, a change of that magnitude in CPython would be madness, b

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > Until someone does the experiment this stuff is bound to be > speculation (what's that saying about "premature optimization"?). 40 years of practical Lisp implementation efforts and around the globe and hundreds of published papers on the subject might n

Re: cgi python

2005-10-13 Thread Paul Boddie
the parameter's value: try: selectedYear = int(query["year"].value) except KeyError: Do something here about the missing parameter. except ValueError: Do something here about a non-integer parameter. Testing Web applications can be hard, but the traceback tells you everything you need to know here. Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Paul Rubin
Scott David Daniels <[EMAIL PROTECTED]> writes: > Current speeds are due to deep pipelines, and a conditional in the > INCREF code would blow a pipeline. I think most of the time, branch prediction will prevent the cache flush. Anyway, with consed integers, there's still going to be a conditional

Re: Let My Terminal Go

2005-10-13 Thread Paul Rubin
Jorgen Grahn <[EMAIL PROTECTED]> writes: > It depends on what you mean by expensive -- web servers can fork for each > HTTP request they get, in real-world scenarios, and get away with it. This is OS dependent. Forking on Windows is much more expensive than forking on Linux. -- http://mail.pytho

Re: Let My Terminal Go

2005-10-13 Thread Paul Rubin
Grant Edwards <[EMAIL PROTECTED]> writes: > Since the NT kernel is descended from VMS, I'm not surprised > that a fork is expensive. Apache 2.x supports concurrency via threading as an alternative to forking, basically in order to get acceptable performance on Windows. -- http://mail.python.org/m

Re: form filling XML

2005-10-13 Thread Paul Boddie
lation for each li element, you're going to be using nested loops rather than a single one. I hope this gets you started on the problem, anyway! Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Paul Rubin
Scott David Daniels <[EMAIL PROTECTED]> writes: > > I think most of the time, branch prediction will prevent the cache > > flush. > But, branch prediction is usually a compiler thing, based on code > that is, in this case, a spot in the interpreter that is actually > taking both sides of the branch

Re: 1-liner to iterate over infinite sequence of integers?

2005-10-13 Thread Paul Rubin
"Fredrik Lundh" <[EMAIL PROTECTED]> writes: > itertools.count() # 0-based > itertools.count(1) # 1-based > > gives you an iterator that generates all Python integers (the behaviour > when it exceeds sys.maxint doesn't seem to be defined, but 2.4 wraps > around to -(sys.maxint+1)) Ugh, I'd

Re: UI toolkits for Python

2005-10-13 Thread Paul Rubin
Kenneth McDonald <[EMAIL PROTECTED]> writes: > 1) Which plays best with Python? Ideally, it would already have some > higher-level python libraries to hide the grotty stuff that is almost > never needed when actually implementing apps. > > 2) Reliability of each? > > 3) Useful external libraries

Re: Jargons of Info Tech industry

2005-10-13 Thread Paul Rubin
Brendan Guild <[EMAIL PROTECTED]> writes: > This was a problem, but modern browsers implement Javascript in such a > way that it requires permission from the user before it will open a new > window. Not really true, it's easy to defeat that, and also generally the pop-up blocker only blocks wind

Re: Send password over TCP connection

2005-10-13 Thread Paul Rubin
"dcrespo" <[EMAIL PROTECTED]> writes: > Ok, I understand... What about the MD5? Is it good enough to use when > saving a hashed password on the database? > > For example: > user_input = raw_input("Type your password: ") > password = md5.md5(user_input).hexdigest() > SavePasswordInDatabase(user,pas

Re: Jargons of Info Tech industry

2005-10-13 Thread Paul Rubin
[EMAIL PROTECTED] (Gordon Burditt) writes: > I'm not sure that you can disable Javascript from reading cookies > from other sites while allowing Javascript to read cookies from the > site it came from on all browsers. Javascript is not supposed to be able to read cross-site cookies. It's bad but i

Re: Send password over TCP connection

2005-10-13 Thread Paul Rubin
"dcrespo" <[EMAIL PROTECTED]> writes: > > Can you say what your application is? That will help figure out > > how far you need to go to protect these passwords, and what > > alternatives might be possible. > > Sure, no problem (see this on fixed text): Well, I mean, what kind of data is it? Spo

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Paul Rubin
"Diez B. Roggisch" <[EMAIL PROTECTED]> writes: > > Yes, that would describe just about every cpu for the past 30 years > > that's a plausible Python target. > > No. The later 68K (>68020) could address on odd adresses. And AFAIK > all x86 can because of their 8080 stemming. Yes, "could" but not "

Re: Send password over TCP connection

2005-10-13 Thread Paul Rubin
"dcrespo" <[EMAIL PROTECTED]> writes: > Important data like diplomatic traffic. Must be accessible from all > Clients inmediatly a client publish his data. Its an online system. OK, if it's actual diplomatic traffic you need to work with your government about criteria. If you're in the US, you'd

Re: 1-liner to iterate over infinite sequence of integers?

2005-10-13 Thread Paul Rubin
Steven D'Aprano <[EMAIL PROTECTED]> writes: > Others have given answers involving xrange() and itertools.count(), but I > thought I'd just mention that in my opinion, what you have written is > pretty elegant and concise and best of all, doesn't have the same problems > xrange() and itertools.count

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Paul Rubin
Steve Holden <[EMAIL PROTECTED]> writes: > >>And this presumes an architecture which byte-addresses and only > >> uses "aligned" addresses. > > He was talking about the arachiteecture, for Pete's sake, not a compiler. Yeah, I noticed that, I could have been pedantic about it but chose to just d

Re: Python's garbage collection was Re: Python reliability

2005-10-13 Thread Paul Rubin
[EMAIL PROTECTED] writes: > Folks, most common GC schemes have been tried as experiments over > the years. None have succeeeded, for various reasons. I think one > of the main reasons is that Python has to "play nice" with external > libraries, many of which weren't written with GC beyond malloc

Re: Jargons of Info Tech industry

2005-10-14 Thread Paul Rubin
Tim Tyler <[EMAIL PROTECTED]> writes: > Are there any examples of HTML email causing security problems - outside > of Microsoft's software? There was a pretty good one that went something like Click this link to download latest security patch! http://www.mxx.com.>Microsoft Security C

Re: Using SRP on TCPServer module

2005-10-14 Thread Paul Rubin
"dcrespo" <[EMAIL PROTECTED]> writes: > Now that you know what I have, I would like to add SRP functionality to > the validation of each new connection. > What I need to add to my code to get SRP to work? I don't know where to > start. The docs are poor. I don't know of a Python SRP module that on

Re: Function to execute only once

2005-10-14 Thread Paul Rubin
"PyPK" <[EMAIL PROTECTED]> writes: > now I want execute() function to get executed only once. That is the > first time it is accessed. > so taht when funcc2 access the execute fn it should have same values as > when it is called from func1. There's nothing built into Python for that. You have to

<    7   8   9   10   11   12   13   14   15   16   >