Re: crawlers in python with graphing?

2006-06-20 Thread bryan rasmussen
Hi, Sorry, was imprecise, I meant not save the downloaded page locally. There probably isn't one though, so I should build one myself. Probably just need a good crawler that can be set to dump all links into dataset that I can analyse with R. Cheers, Bryan Rasmussen On 6/19/06, Marc '

crawlers in python with graphing?

2006-06-19 Thread bryan rasmussen
nload the pages but just follow the links, and output graphs. Cheers Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: numeric/numpy/numarray

2006-06-13 Thread Bryan
Ben Sizer wrote: > Bryan wrote: > >> at the end of that page, it says: >> >> "Numarray is another implementation of an arrayobject for Python written >> after >> Numeric and before NumPy. Sponsors of numarray have indicated they will be >> moving t

Re: numeric/numpy/numarray

2006-06-13 Thread Bryan
Simon Percivall wrote: > Bryan wrote: >> hi, >> >> what is the difference among numeric, numpy and numarray? i'm going to start >> using matplotlib soon and i'm not sure which one i should use. >> >> >> this page says, "Numarray is a re-

numeric/numpy/numarray

2006-06-12 Thread Bryan
es/software_hardware/numarray this page says, "NumPy derives from the old Numeric code base and can be used as a replacement for Numeric." http://numeric.scipy.org/ i looked at the matplotlib examples today and if i remember correctly, the examples didn't use numarray. so

language-x-isms

2006-06-07 Thread Bryan
of these language-x-isms that people on this list have seen. i think it would be helpful to both the new java-to-python developer and python developers in general to be aware of these. just an idea. feel free to discuss any language-x-isms, not necessarily just java-isms. bryan -- http://ma

Re: Open Source Charting Tool

2006-06-05 Thread Bryan
Harry George wrote: > See pygdchart > http://www.nullcube.com/software/pygdchart.html > this looks pretty nice. i don't see in the docs if and how it can be integrated with other gui toolkits such wxpython. :( bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: graphs and charts

2006-05-24 Thread Bryan
example 9. does biggles integrate well wxPython? if so, do you have an example of how to add it to a wxPython panel? thanks, bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: groupby

2006-05-22 Thread Bryan
George Sakkis wrote: > Bryan wrote: > >> can some explain why in the 2nd example, m doesn't print the list [1, 1, 1] >> which i had expected? >> >> >> >>> for k, g in groupby([1, 1, 1, 2, 2, 3]): >> ... print k, list(g) >>

groupby

2006-05-22 Thread Bryan
, (2, ), (3, )] >>> list(m[0][1]) [] >>> thanks, bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Tabs versus Spaces in Source Code

2006-05-14 Thread Bryan
Xah Lee wrote: > Tabs versus Spaces in Source Code > > Xah Lee, 2006-05-13 > > In coding a computer program, there's often the choices of tabs or > spaces for code indentation. There is a large amount of confusion about > which is better. It has become what's known as “religious war” — > a heated

matplotlib

2006-05-11 Thread Bryan
does anyone know if matplotlib is robust enough to use in a commercial application? are there any existing commercial or popular open source programs that use it? thanks, bryan -- http://mail.python.org/mailman/listinfo/python-list

lines of code per functional point

2006-05-09 Thread Bryan
lue for python, but i did find other sites that show java and c++ at 53 LOC/FP which is the same as this document. is it safe to assume that python's value would be similar to perl's value of 21 ? http://www.abo.fi/~kaisa/FN.pdf thanks, bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythoncard question

2006-05-04 Thread bryan rasmussen
oops, sorry about that. I copied the message over in gmail but forgot to change the subject. Sorry, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

refactoring question

2006-05-04 Thread bryan rasmussen
d[.='" + word + "']" xp = Evaluate(xexpr,doc.documentElement) if len(xp) < 1: loc.appendChild(thisloc) text = doc.createTextNode(word) thisloc.appendChild(text) fi = open(folderwords, "w") fi.write(doc.toxml()) Cheers, Bryan Rasmussen -- http://mail.python.org/mailman/listinfo/python-list

Re: Pythoncard question

2006-05-04 Thread bryan rasmussen
thisloc = doc.createElementNS("", "word") xexpr= "//word[.='" + word + "']" xp = Evaluate(xexpr,doc.documentElement) if len(xp) < 1: loc.appendChild(thisloc) text = doc.create

Re: stripping unwanted chars from string

2006-05-03 Thread Bryan
> >>> keepchars = set(alphabet + alphabet.upper() + '1234567890-.') or >>> keepchars = set(string.letters + string.digits + '-.') bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: python strings

2006-05-03 Thread Bryan
>>>> s[0] == chr(0) > True > > - -- Gerhard this works too :) >>> s = '\x001' >>> s[0] == chr(0) True >>> s = '\x00abc' >>> s[0] == chr(0) True i think it would be more clear not to use 3 digits for this example si

Re: ANN: pywinauto 0.3.0 released - now localization proof

2006-03-21 Thread Bryan
emo and it's very nice. the only thing was in the demo it shows one Click() method to close the notepadabout dialog. but for me on windows xp media edition, it took two Click() methods. the first click clearly had the button depressed and the second click released the button back up. is this a bug in 0.3.0? or is it the new way of doing it... two clicks for each button? also, i would be really nice if the FAQ mentioned where you could get free or opensourced spy utilities so you could spy on controls and get their id values or internal names. thanks, bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Using len()

2006-03-11 Thread Bryan Olson
ut this throws the following error and I have no idea why. Please > enlighten. > > My error ==> len() of unsized object The innocent sounding function "input()" actually invokes the perilous "eval()". Read about it at: http://docs.python.org/l

Re: generators shared among threads

2006-03-10 Thread Bryan Olson
se it has a gi_frame attribute? Would generators be thread-safe > only in CPython? I have not found definitive answers in the Python doc. Both generators and threads keep their own line-of-control, and how they interact is not clear. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: AES encryption

2006-03-10 Thread Bryan Olson
all your code, and > check the results against 3 popular test vectors. > > --Bryan > > > # Assert false if test fails > > test_key = ( > 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, > 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c, >

can't send large messages over SSL socket

2006-03-09 Thread Bryan
#x27;POST', '/foo', message, header) res = con.getresponse().read() thanks, bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: generators shared among threads

2006-03-08 Thread Bryan Olson
= threading.Lock() i = 0 while True: lock.acquire() yield i i += 1 lock.release() fgen = f() def count3(): for _ in range(3): print '---', fgen.next() time.sleep(10) start_daemon(count3) time.sleep(1.0) print "+++", fgen.next() -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading binary from a file...

2006-03-08 Thread Bryan Olson
files hold sequences of eight-bit integers. How you convert from those to your 16-bit type depends on how the the writer of the file converted the 16-bit integer type to a sequence 8-bit integers. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Opening files without closing them

2006-03-07 Thread Bryan
level routine that cares or knows what to do. f = open('file') try: # do something finally: f.close() if i really want to handle the exception, then i handle it at a conceptually "higher" level by wrapping it in an exception which is basically what some higher-level routine would do anyways. try: f = open('file) try: # do something finally: f.close() except IOError: # handle exceptions bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: AES encryption

2006-03-07 Thread Bryan Olson
opular test vectors. --Bryan # Assert false if test fails test_key = ( 0x2b, 0x7e, 0x15, 0x16, 0x28, 0xae, 0xd2, 0xa6, 0xab, 0xf7, 0x15, 0x88, 0x09, 0xcf, 0x4f, 0x3c, 0x76, 0x2e, 0x71, 0x60, 0xf3, 0x8b, 0x4d, 0xa5, 0x6a, 0x78, 0x4d, 0x90, 0x45, 0x19,

Re: Cryptographically random numbers

2006-03-06 Thread Bryan Olson
ng: for i in xrange(300): assert s2num(num2string(i)) == i for i in xrange(1, 20): for _ in xrange(100): r = os.urandom(i) assert num2string(s2num(r)) == r.lstrip(chr(0)) -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Cryptographically random numbers

2006-03-06 Thread Bryan Olson
ers random.SystemRandom, which will generate integers in any desired range using os.urandom as the entropy source. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Cryptographically random numbers

2006-03-06 Thread Bryan Olson
def s2num(text): return int(hexlify(text) or '0', 16) -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: spliting on ":"

2006-03-06 Thread Bryan Olson
ks who don't know this to start developing the > safer habit, which is always to use "is" and "is not" with None (or, > generally, with other singletons). Hmmm... To make my code safer, I'm thinking I should replace doc strings that say "if bluf is Null"

Re: Random Prime Generator/Modular Arithmetic

2006-03-06 Thread Bryan Olson
for _ in xrange(pow2): prev = r r = r * r % n if r == 1: return prev in (1, n - 1) return r == 1 -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Cryptographically random numbers

2006-03-06 Thread Bryan Olson
it should hold up to a test, it seems to > work alright. Have to disagree. Try: for _ in range(100): print cran_rand(0, 500) How many numbers greater than 255 do you get? I have more comments, but that's the biggest issue. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Question re client/server and blocking

2006-03-05 Thread Bryan Olson
ike > this - Right. The server should go into a state where it can accept the answer, among other things. Building interactive apps that don't suck requires some sophistication in managing state. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Random Prime Generator/Modular Arithmetic

2006-03-05 Thread Bryan Olson
e Hmmm...my M-R tester disagrees... Ah, there's another bug in is_strong_pseudo_prime(). While your exponent 'x' is even, you do the test with x, not necessarily x/2. Incidentally, the lowest base for which 561 is strongly pseudo-prime is 50. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Random Prime Generator/Modular Arithmetic

2006-03-05 Thread Bryan Olson
ver it, RSA requires "padding" of the plaintext data. Google RSA + Padding for more. Or ask on sci.crypt. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is Python a Zen language?

2006-02-25 Thread Bryan Olson
ter? Of course they are. Algol and Java don't transform people's thinking about programming? Nonsense. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Multiple threaded download streams?

2006-02-25 Thread Bryan Olson
Twisted-state-machines needed. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: time.sleep(1) sometimes runs for 200 seconds under windows

2006-02-24 Thread Bryan Olson
Paul Probert wrote: [...] > Its happening roughly 4 times a day total on our 20 machines, ie about > once every 5 days on a given machine. Do they all have similar anti-virus programs? Some of those can freeze out other tasks from time to time. Just one more candidate. -- --Bryan --

Re: Databases and python

2006-02-20 Thread Bryan Olson
keys to multiple values: http://sleepycat.com/docs/ref/am_conf/dup.html Below is a simple example. --Bryan import bsddb def add_words_from_file(index, fname, word_iterator): """ Pass the open-for-write bsddb B-Tree, a filename, and a list (or any interable) of

Re: Databases and python

2006-02-17 Thread Bryan Olson
Dan Stromberg wrote: > Bryan Olson wrote: [...] >> Well, you could use simple files instead of fancy database tables. > > That's an interesting thought. Perhaps especially if australopithecine > were saved in a filename like: > > ~/indices/au/st/ra/lo/pi/th/ec/in

Re: %SystemDrive%

2006-02-16 Thread Bryan Olson
Atanas Banov wrote: > Bryan Olson wrote: > >>To get it with the \, you might use: >> >> os.path.abspath(os.environ['SYSTEMDRIVE']) > > > wrong! > the result is incorrect if the current directory is different from the > root. Oops, sorry. I

Re: Databases and python

2006-02-16 Thread Bryan Olson
filenames to a word shouldn't bog > down much at all. Well, you could use simple files instead of fancy database tables. Below is a demo of an alternate technique that uses bsddb B-Trees, and puts both the word and the file-id in the key. I don't know how efficient it is for real data,

Re: %SystemDrive%

2006-02-15 Thread Bryan Olson
e \, you might use: os.path.abspath(os.environ['SYSTEMDRIVE']) -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: is socket thread safe?

2006-02-15 Thread Bryan Olson
blem are you trying to solve? Normal socket sending, receiving, and shutdown discipline work fine. When the writer is done writing, it should call sock.shutdown(socket.SHUT_WR). When the reader gets zero bytes from recv(nonzero), that means the remote end has finished writing, so the reader may call sock.shutdown(socket.SHUT_RD). -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: is socket thread safe?

2006-02-15 Thread Bryan Olson
that much is safe and perfectly reasonable. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is empty string cached?

2006-02-15 Thread Bryan Olson
riables are removed, does the item still exist in the cache? Either; see the same reference page. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about idioms for clearing a list

2006-02-10 Thread Bryan Olson
Magnus Lycka wrote: > Bryan Olson wrote: > >> Magnus Lycka wrote: >> >>> Bryan Olson wrote: >>> >>>> big_union = set() >>>> for collection in some_iter: >>>> big_union.update(t) >>>> colle

Re: Question about idioms for clearing a list

2006-02-10 Thread Bryan Olson
;s a decision from long ago. Now that we have sets and the iterable protocol, the case is quite different. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about idioms for clearing a list

2006-02-10 Thread Bryan Olson
Magnus Lycka wrote: > Bryan Olson wrote: > >> Magnus Lycka wrote: >> >>> Do you really have a usecase for this? It seems to me that your >>> argument is pretty hollow. >> >> >> Sure: >> >> if item_triggering_end in colle

Re: Question about idioms for clearing a list

2006-02-09 Thread Bryan Olson
Magnus Lycka wrote: > Bryan Olson wrote: > >> The original question was about idioms and understanding, but >> there's more to the case for list.clear. Python is "duck typed". >> Consistency is the key to polymorphism: type X will work as an >> actua

Re: Threads and Interpreter death

2006-02-09 Thread Bryan Olson
t; http://docs.python.org/lib/module-thread.html And you might also want to see threading.thread's setDaemon() method: The entire Python program exits when no active non-daemon threads are left. http://docs.python.org/lib/thread-objects.html -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about idioms for clearing a list

2006-02-08 Thread Bryan Olson
they do the expected things. Emptying out a collection is logically the same thing whether that collection is a list, set, dictionary, or user-defined SortedBag. When different types can support the same operation, they should also support the same interface. That's what enables polymorphism. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Too Many if Statements?

2006-02-07 Thread Bryan Olson
Terry Reedy wrote: > "Bryan Olson" wrote: > >>I made a script with 100,000 if's, (code below) and it appears >>to work on a couple systems, including Python 2.4.2 on Win32-XP. >>So at first cut, it doesn't seem to be just the if-count that >>tri

Re: Question about idioms for clearing a list

2006-02-07 Thread Bryan Olson
Fredrik Lundh wrote: > Bryan Olson wrote: > > >>So is consistency; it ain't Perl, thank Guido. > > consistency is the hobgoblin of little minds. Look up that saying. Any clues? >>Python now has, what, three built-in mutable collections types: >>lists,

Re: Too Many if Statements?

2006-02-07 Thread Bryan Olson
quot;""] for i in range(10): lines.append('if n % random.randrange(2, 1000) == 0: c += 1') lines.append('print c') lines.append('##') progtext = '\n'.join(lines) f = file('manyifs.py', 'w') f.write(progtext) f.close() exec progtext -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about idioms for clearing a list

2006-02-07 Thread Bryan Olson
slicings. So is consistency; it ain't Perl, thank Guido. Python now has, what, three built-in mutable collections types: lists, dictionaries, and sets. Dicts and sets both have a clear() method and lists do not. That's a wart, minor but easily fixed. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: threads and memory

2006-02-06 Thread Bryan Olson
you should be able to create threads numbering in the low thousands. (On 64-bit systems, the issue just goes away.) -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread imbalance

2006-02-06 Thread Bryan Olson
peration, and reacquire it right after. See: http://docs.python.org/api/threads.html -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread imbalance

2006-02-06 Thread Bryan Olson
ts without polling by waiting for either a Semaphore or a timer. With Python's standard thread and threading libraries, there's no good way to do so. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Thread imbalance

2006-02-06 Thread Bryan Olson
n a custom read function that doesn't > depend so much on processing power. That is odd. Python should release its global lock while waiting for I/O, and thus other threads should run. What read function are you using? Can you provide a minimal example of your problem? -- --Bryan -- h

Re: socket examples

2006-01-24 Thread Bryan Olson
I myself have posted code that was outright wrong, so I don't want to come down too hard on any particular author. Nevertheless, we who advocate Python have to be concerned that such a basic error appears in one of very few HowTo documents. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Some thougts on cartesian products

2006-01-24 Thread Bryan Olson
Christoph Zwerschke wrote: > Bryan Olson wrote: > >> The claim "everything is a set" falls into the category of >> 'not even wrong'. > > No, it falls into the category of the most fundamental Mathematical > concepts. You actually *define* tuples a

Re: socket examples

2006-01-24 Thread Bryan Olson
you pass. Python's sockets offer the convenient method sendall() which does send all the data it is passed before returning. When using a thread per connection, sendall() is the way to go. > conn.close() Right; closing is good practice. As noted above, I recommend shutting down writing and detecting end-of-data before closing. Incidentally, shutting down reading is utter trivia and best left to close(). -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Some thougts on cartesian products

2006-01-23 Thread Bryan Olson
Christoph Zwerschke wrote: > Bryan Olson schrieb: > >>> Still think there is no such thing? >> >> >> Uh, yes. >> >>The Cartesian product of two sets A and B (also called the >>product set, set direct product, or cross product) is defi

Re: list comprehention

2006-01-23 Thread Bryan Olson
Bryan Olson wrote: > Duncan Booth wrote: > >> Here's the way I would do it: >> >>>>> def occurrences(it): >> >> >> res = {} >> for item in it: >> if item in res: >> res[item] += 1 >>

Re: Some thougts on cartesian products

2006-01-23 Thread Bryan Olson
Kay Schluehr wrote: > Bryan Olson wrote: > > >>There's no such thing; you'd have to define it first. Are duplicates >>significant? Order? > > > That's all trivial isn't it? A string is a set of pairs (i,c) where i > is an integer number, t

Re: Some thougts on cartesian products

2006-01-23 Thread Bryan Olson
Steven D'Aprano wrote: > On Mon, 23 Jan 2006 18:17:08 +0000, Bryan Olson wrote: > > >>Steven D'Aprano wrote: >> >>>Bryan Olson wrote: >>> >>[Christoph Zwerschke had written:] >> >>>>>What I expect as the result is the &q

Re: Some thougts on cartesian products

2006-01-23 Thread Bryan Olson
Steven D'Aprano wrote: > Bryan Olson wrote: > > [Christoph Zwerschke had written:] >>>What I expect as the result is the "cartesian product" of the strings. >> >>There's no such thing; you'd have to define it first. Are duplicates >>s

Re: Some thougts on cartesian products

2006-01-23 Thread Bryan Olson
Steven D'Aprano wrote: > Bryan Olson wrote: >>Christoph Zwerschke wrote: >>[...] >> >>>That may be the main problem to decide whether the cartesian product >>>should return a generator or a list. >> >>The Cartesion product is a set. >

Re: Some thougts on cartesian products

2006-01-23 Thread Bryan Olson
ited and in these cases you can either write nested > loops or write your own cartesian product. Cartesian product is one of the essential operations of relational algebra; in that context it's widely useful. By itself, it's usually not what one wants. -- --Bryan -- http://mail.pyth

Re: Who is www.python.org for? (was Re: New Python.org website ?)

2006-01-22 Thread Bryan
egantly solve the suits vs developer issue. for those who like fancy images on the home page, you could now have an image that clearly links to each subdomain. you could even have a search on the home page that searches all the python subdomains. bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Some thougts on cartesian products

2006-01-22 Thread Bryan Olson
the result to be a generator: (a + b for a in 'hello' for b in 'world') New language features should be widely useful, and difficult or awkward to code in Python as it is. All-combinations-of-sequences is trivial to code and rarely needed. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: list comprehention

2006-01-20 Thread Bryan Olson
The generalized problem is multiset (AKA "bag") intersection: http://en.wikipedia.org/wiki/Bag_(mathematics) -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a maximum length of a regular expression in python?

2006-01-20 Thread Bryan Olson
pression engine > > > I don't know of any stated maximum length, but I'm not at all surprised > this causes the regex compiler to blow up. This is clearly a case of regex > being the wrong tool for the job. Does no one care about an internal error in the regular expression engine? -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficient implementation of deeply nested lists

2006-01-19 Thread Bryan Olson
me. Any ideas? The problem is that all your lists/sublists have different values. "recompute" doesn't really even apply. If x != y, then no two sublists found within L(x) plus L(y) are equal (excluding sublists that might be within x or y). -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Socket Programming HOWTO example

2006-01-17 Thread Bryan Olson
I mis-phrased: > The code passes > 'self' to __init__, but not to any of the others methods. Of course I meant that the formal parameter for self is missing. > > class mysocket: > >> '''classe solamente dimostrativa >> - codificata per chiarezza, non per efficenza''' >>

Re: Socket Programming HOWTO example

2006-01-17 Thread Bryan Olson
> if chunk == '': > raise RuntimeError, \\ > "connessione socket interrotta" > msg = msg + chunk > return msg > How can i use this? Treat it as a "HowNotTo". -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: two questions about thread

2006-01-16 Thread Bryan Olson
o die. Doesn't work, because threads can be blocked. Worse, some threads may be blocked waiting for others to release them. The unblocked threads check the flag and exit, so they're never signal the blocked ones. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Bryan Olson
hat makes our results cleaner. [...] > Ain't got none. On the other hand, I'm not trying to prove that such > objects exist. I'm trying to find out if there's any justification for > claiming that they don't exist. It's the reference, it gets to decide. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Bryan Olson
Fredrik Lundh wrote: > Bryan Olson wrote: > > >>I think the following is correct: an object's identity is not part >>of its value, while its type is. > > > you're wrong. an object's identity, type, and value are three different > and distinc

Re: Is 'everything' a refrence or isn't it?

2006-01-15 Thread Bryan Olson
Mike Meyer wrote: > Bryan Olson <[EMAIL PROTECTED]> writes: > >>Mike Meyer wrote: >> >>>Bryan Olson <[EMAIL PROTECTED]> writes: >>> >>>>Mike Meyer wrote: >>>> >>>>>Bryan Olson writes: >>>>The Pyth

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Bryan Olson
Mike Meyer wrote: > Bryan Olson <[EMAIL PROTECTED]> writes: > >>Mike Meyer wrote: >> >>>Bryan Olson writes: >>> >>>>[EMAIL PROTECTED] wrote: >>>> >>>> >>>>>The reason is that I am still trying to figu

Re: two questions about thread

2006-01-14 Thread Bryan Olson
of the questions above, or another issue? -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Bryan Olson
Fredrik Lundh wrote: > Bryan Olson wrote: > > >>>The identity is not, in itself, a part of the value. >>> >>>Python doesn't query the object to determine it's type or identity, but it >>>always has to query the object to access the value. &g

Re: Is 'everything' a refrence or isn't it?

2006-01-14 Thread Bryan Olson
The ob_type field contains the type. So, was it an editing error when you said that Python does not query the object to determine its type? The type is there in the object, and and in Python, variables and references are not typed. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Subclassing socket

2006-01-13 Thread Bryan Olson
Kind of the other side of sock.sendall. """ parts = [] while size > 0: data = sock.recv(size) if not data: raise SomeException("Socket closed early.") size -= len(data) parts.append(data) return ''.join(parts) -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Bryan Olson
7;instance', I mean a direct instance, not an instance of a class that inherits from 'object'. Would it make sense to have a type with an empty set of values? Sure. Such a type could never have a direct instance. Perhaps 'object' should be an abstract base class. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Converting a string to an array?

2006-01-13 Thread Bryan Olson
orting, we had the procedure 'sort', then added the pure function 'sorted'. We had a 'reverse' procedure, and wisely added the 'reversed' function. Hmmm... what we could we possible do about 'shuffle'? -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-13 Thread Bryan Olson
Mike Meyer wrote: > Bryan Olson writes: > >>[EMAIL PROTECTED] wrote: >> >>>The reason is that I am still trying to figure out >>>what a value is myself. Do all objects have values? >> >>Yes. > > > Can you justify this, other than by qu

Re: Is 'everything' a refrence or isn't it?

2006-01-12 Thread Bryan Olson
I think type 'object' has only one value, so that's it. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Implementing Tuples with Named Items

2006-01-09 Thread Bryan
ates to 2 in this case. how does itemgetter (and property) know what tuple to use? in my itemgetter sample, the tuple is passed to itemgetter so it's obvious to see what's going on. but in the supertup example, it isn't obvious to me. thanks, bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-07 Thread Bryan Olson
Steven D'Aprano wrote: > Bryan Olson wrote: >>Wrong. C does not have references, and the Python use is consistent >>with the rest of computer science. You seem to have read in things >>that it does not mean. Fix *your* thinking. > > > Bryan, I'll a

Re: Is 'everything' a refrence or isn't it?

2006-01-07 Thread Bryan Olson
Steven D'Aprano wrote: > On Thu, 05 Jan 2006 05:21:24 +0000, Bryan Olson wrote: > > >>Steven D'Aprano wrote: >> >>>Mike Meyer wrote: >> >>[...] >> >>>>Correct. What's stored in a list is a reference. >>> >>

Re: Regex anomaly

2006-01-04 Thread Bryan Olson
could define the __or__ method for RegExFlags, but really, or-ing together integer flags is old habit from low-level languages. Really we should pass a set of flags. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Bryan Olson
ht, and you're wrong. Look at the *code*. There isn't a > single call in it. He may have said "call by reference" Actually he didn't. Steven added "call by" in his paraphrase. -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Is 'everything' a refrence or isn't it?

2006-01-04 Thread Bryan Olson
re called containers. Examples of containers are tuples, lists and dictionaries. [http://docs.python.org/ref/objects.html] -- --Bryan -- http://mail.python.org/mailman/listinfo/python-list

Re: Raw images

2005-12-20 Thread Bryan Olson
; this differs somewhat from program to program. Well, maybe it's easy. Perhaps a straightforward interpretation of the numbers, along with the dimensions you know, will yield the image. It might be harder. For an arguably-overstated exposition, see: http://luminous-landscape.com/ess

Re: Double-Ended Heaps

2005-12-18 Thread Bryan Olson
ses another issue: distinct objects can compare as equal, so the DeHeap2 operations that find items by value will be at least under-defined, and maybe even broken. There are several ways to solve the problem, and I don't know of Python convention as to which to choose. -- --Bryan -- http://

Re: Python as Guido Intended

2005-11-25 Thread Bryan
> > i agree with you... pyrex should be part of the python distribution :) bryan -- http://mail.python.org/mailman/listinfo/python-list

<    1   2   3   4   5   6   7   8   >