Re: tuple.index()

2006-12-14 Thread Nick Maclaren
lace you put the subscription method, clearly. I really don't see the problem. I can see that it has not been done because Guido and others felt that it wasn't worth doing, but not that it is hard to do. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-14 Thread Nick Maclaren
of entities where there is no definable concept of equivalence between entities, and Python has no such entities as far as I know. Guido's response is fine - we didn't because we didn't think that it was worth doing. One can dissent, but it makes perfect sense. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-14 Thread Nick Maclaren
ll. [ Incidentally, my use was in argument decoding, where the Python layer holds the arguments as strings, and I need to pass them as an index to C (so they DO form a respectable tuple even in Guido's sense, being fixed in number and value and just happening to be homogeneous). ] Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-14 Thread Nick Maclaren
with that. I consider the difficulty of adding a reliable immutable attribute in most languages to be a serious piece of misdesign, but there isn't a huge amount of point unless it is done properly. Unreliable safety devices are as likely to increase errors as reduce them, at least in the han

Re: tuple.index()

2006-12-15 Thread Nick Maclaren
ple. If a heterogeneous list just happens to have objects that are all similar, does it remain heterogeneous? Loose guidelines are very useful, but should almost always come with the rider "Follow these unless you have good reasons to ignore them, but do make sure that you understand the rules fir

Re: tuple.index()

2006-12-16 Thread Nick Maclaren
cantly. Python has chosen not to do that. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-16 Thread Nick Maclaren
f course then we would have |> to define necessary... It's not necessary :-) Lists, in Python, are no more homogeneous than tuples in any sense that I have located. As I posted earlier, if anyone knows of one, please tell me. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-17 Thread Nick Maclaren
in Python terms, because |> Python doesn't formally embody the concept. But that |> doesn't mean the concept isn't real. Of course the concept is real, but the point is that Python doesn't embody the concept of homogeneity in lists, formally or informally, as far as I kno

Re: tuple.index()

2006-12-18 Thread Nick Maclaren
n analogy between. Unfortunately, you are confusing the issue, because there are far more extraneous aspects than relevant ones, and your view of the similarities requires looking at the issue in a very strange way. I think that I can see what you mean, but only just. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-19 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, greg <[EMAIL PROTECTED]> writes: |> Nick Maclaren wrote: |> |> > Unfortunately, you are confusing the issue, because there are far |> > more extraneous aspects than relevant ones, and your view of the |> > similarities req

Re: tuple.index()

2006-12-19 Thread Nick Maclaren
type the "lists are intended to be homogenous" people use to implement mutable heterogenous sequences, or whether they claim that wanting such a feature is heresy :-) Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-19 Thread Nick Maclaren
you. Just as you can use a string as a list. We |> don't have to be rigid to appreciate the difference. :) Nope. That is DEFINITELY wrong. If you write code that abuses a language construct in a way that is discouraged but just happens to work, a couple of decades down the line it wi

Re: tuple.index()

2006-12-20 Thread Nick Maclaren
;t have all the |> features you want. Which is tantamount to saying that Python doesn't support mutable heterogeneous sequences, even though they are not locked out. That is more than just odd - it is almost unbelievable. They are a very basic data structure, after all! Regards, Nick Mac

Re: tuple.index()

2006-12-20 Thread Nick Maclaren
3, agent2, agent3, agent4, str4, ...] See Algol 68 for an example of this. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-21 Thread Nick Maclaren
ing to the mind of anyone who sees the terms, most especially if they are familiar with their use in other areas of computing and mathematics. But, given that meaning, I now understand your point. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: tuple.index()

2006-12-21 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, "Hendrik van Rooyen" <[EMAIL PROTECTED]> writes: |> "Nick Maclaren" <[EMAIL PROTECTED]> wrote: |> |> > Not at all. I didn't say that they came in pairs. Consider: |> > |> > [str1, str2, ag

Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
x = (1.234567890125, 1.2345678901255) print x print x[0], x[1] >>> (1.234567890124, 1.2345678901254999) >>> 1.23456789012 1.23456789013 Is there a rational reason, or is that simply an artifact of the way that the code has evolved? It is clearly not a bug :-) Rega

Re: Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
rational and an artifact of the way the code has evolved! Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Bjoern Schliessmann <[EMAIL PROTECTED]> writes: |> Nick Maclaren wrote: |> |> > Ah! That explains it. I would call that reason intermediate |> > between rational and an artifact of the way the code has evolved! |> |> Whi

Re: Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> writes: |> Nick Maclaren wrote: |> |> > The use of different precisions for the two cases is not, however, |> > and it is that I was and am referring to. |> |> that's by design, of course

Re: Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
olved in a religious war over - I was merely puzzled as to the odd behaviour, because I have to teach it, and it is the sort of thing that can confuse naive users. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
ay". Not at all. "Precision" has been used to indicate the number of digits after the decimal point for at least 60 years, probably 100; in 40 years of IT and using dozens of programming languages, I have never seen "display" used for that purpose. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Bizarre floating-point output

2007-01-08 Thread Nick Maclaren
uot;, "de f,", "gh), i") |> |> would be extremely confusing if the current behaviour was changed. See |> http://www.python.org/sf/1534769 |> for details. Well, I wasn't complaining - merely querying. If this approach is taken, it would be better to document

Re: Maths error

2007-01-09 Thread Nick Maclaren
atter entirely, and will merely confuse you. I have a course on computer arithmetic, and am just now writing one on Python numerics, and confused people may contact me - though I don't guarantee to help. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Maths error

2007-01-09 Thread Nick Maclaren
2.0) are necessarily within the range (x,y) in decimal, even for the most respectable values of x and y. This was a MAJOR "gotcha" in the days before binary became standard, and will clearly return with decimal. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Maths error

2007-01-09 Thread Nick Maclaren
tr(some_float) and repr(some_float) and why str(some_tuple) uses the repr() of |> its elements. Precisely. And it also applies to strings, which I had failed to notice: >>> print ("1","2") ('1', '2') >>> print "1", "2" 1 2 Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity: GIL, processes and CPUs etc

2006-02-15 Thread Nick Smallbone
[EMAIL PROTECTED] wrote: > I have been reading many of the posting on the GIL and impact on > threading etc. > I have found is confusing and would welcome some clarity on this. > > I understand that embedding the interpreter in a C/C++ application > limits it to one CPU. > If the application is mul

Re: How to force creation of a .pyc?

2006-02-22 Thread Nick Smallbone
mrstephengross wrote: > I would like to distribute a python program, but only in .pyc form (so > that people cannot simply look at my code). Is there a way to do this? > I've read up a little on the logic by which python creates .pyc's, and > it sounds like python requires the main executed program

Re: Running script in background.

2005-05-01 Thread Nick Addison
Have you considered running the exe as a scheduled job? Or you could turn it into an NT service. I run quite a few py2exe exes as scheduled jobs set up as run once on system start up. hth Nick. -- http://mail.python.org/mailman/listinfo/python-list

Re: Whats the best Python Book for me

2005-05-03 Thread Nick Vargish
will help you figure out how Python programmers solve typical (and sometimes not-so-typical) real-world problems. Nick -- # sigmask (lambda deprecation version) 20041028 || feed this to a python print ''.join([chr(ord(x)-1) for x in 'Ojdl!Wbshjti!=ojdlAwbshjti/psh?']) --

Re: So many things that need to be decided....

2005-05-05 Thread Nick Vargish
ou never, ever, accidentally mix spaces and tabs... Nick -- # sigmask (lambda deprecation version) 20041028 || feed this to a python print ''.join([chr(ord(x)-1) for x in 'Ojdl!Wbshjti!=ojdlAwbshjti/psh?']) -- http://mail.python.org/mailman/listinfo/python-list

Re: Python analog of Ruby on Rails?

2005-06-01 Thread Nick Vargish
bruno modulix <[EMAIL PROTECTED]> writes: > Err... Looks like I've seen this before, but where ??? Don't know, but it looks sort of familiar... Nick -- # sigmask (lambda deprecation version) 20041028 || feed this to a python print ''.join([chr(ord(x)-1) for x i

Re: Properties on old-style classes actually work?

2007-05-07 Thread Nick Vatamaniuc
ork but as soon as you use the set property it fails and even 'get' won't work after that. It surely is deceiving, I wish it would just give an error or something. See below. -Nick Vatamaniuc >>> class O: : def __init__(self): : self._x=15

Re: assisging multiple values to a element in dictionary

2007-05-07 Thread Nick Vatamaniuc
.Like i want the > key 170 to take either the name 'dataPackageID' or the name > 'LocalId'.I use this in my code,and hence if either comes it should > work . > Can someone help me. > Thanks id_lookup[170]=('dataPackageID', 'LocallId') -Nick V. -- http://mail.python.org/mailman/listinfo/python-list

Re: randomly write to a file

2007-05-07 Thread Nick Vatamaniuc
rest of the lines will have to be shifted to accommodate, the potentially larger new line. -Nick Vatamaniuc On May 7, 3:51 pm, rohit <[EMAIL PROTECTED]> wrote: > hi, > i am developing a desktop search.For the index of the files i have > developed an algorithm with which > i shou

Re: How to make Python poll a PYTHON METHOD

2007-05-07 Thread Nick Vatamaniuc
gt;> from threading import Timer >>> timer=Timer(5.0,baz) >>> timer.start() >>> Baz! >>> Cheers, -Nick Vatamaniuc -- http://mail.python.org/mailman/listinfo/python-list

Re: How to make Python poll a PYTHON METHOD

2007-05-07 Thread Nick Vatamaniuc
On May 7, 10:42 pm, Nick Vatamaniuc <[EMAIL PROTECTED]> wrote: > On May 7, 10:07 pm, johnny <[EMAIL PROTECTED]> wrote: > > > Is there a way to call a function on a specified interval(seconds, > > milliseconds) every time, like polling user defined method? > >

Re: Multiple regex match idiom

2007-05-09 Thread Nick Vatamaniuc
way to > write the above code? Hrvoje, To make it more elegant I would do this: 1. Put all the ...do somethings... in functions like re1_do_something(), re2_do_something(),... 2. Create a list of pairs of (re,func) in other words: dispatch=[ (re1, re1_do_something), (re2, re2_do_something), .

Re: view workspace, like in MatLab ?

2007-05-09 Thread Nick Vatamaniuc
try: [var for var in dir() if not (var.startswith('_') or var=='var')] Example: --- >>> a=10 >>> b=20 >>> [var for var in dir() if not (var.startswith('_') or var=='var')] ['a', 'b'] >>> --- Hope that helps, Nick Vatamaniuc -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about bsddb

2007-05-09 Thread Nick Vatamaniuc
ields. The result was that my disk I/ O was saturated (i.e. the application was running as fast as the hard drive would let it), so it was good enough for me. Hope this helps, -Nick Vatamaniuc -- http://mail.python.org/mailman/listinfo/python-list

Re: Questions about bsddb

2007-05-09 Thread Nick Vatamaniuc
On May 9, 4:01 pm, [EMAIL PROTECTED] wrote: > Thanks for the info Nick. I plan on accessing the data in pretty much > random order, and once the database is built, it will be read only. > At this point Im not too concerned about access times, just getting > something to work. I

Re: Sorting attributes by catagory

2007-05-09 Thread Nick Vatamaniuc
It seems I can get some of these fairly easy with the inspect module, but > others I need to test in multiple ways. > > Any ideas? > > Cheers, > Ron Ron, Consider using epydoc if you can. Epydoc will sort the methods and it will also let you use custom CSS style sheets for the final HT

Re: PYDOC replacement. (Was:Sorting attributes by catagory)

2007-05-10 Thread Nick Vatamaniuc
On May 10, 1:28 am, Ron Adam <[EMAIL PROTECTED]> wrote: > Nick Vatamaniuc wrote: > > Ron, > > > Consider using epydoc if you can. Epydoc will sort the methods and it > > will also let you use custom CSS style sheets for the final HTML > > output. Check out the

Re: Setting thread priorities

2007-05-13 Thread Nick Vatamaniuc
riority value between 0.0 (the lowest) and up. Then look at the run trace and notice that on average the 0.75 priority thread is called more often than the 1.0 priority. Hope this helped, -Nick Vatamaniuc >>> from threading import Thread >>> from time import sleep

Re: Beginner question: module organisation

2007-05-14 Thread Nick Vatamaniuc
rsMesh(BaseMesh): def __init__(self,...): BaseMesh.__init__(self,...) etc. initializer... def refine(self,...): ...user's refine method would go here... -- So for each different refine() method the user can

Re: Sorting troubles

2007-05-14 Thread Nick Vatamaniuc
modified in place, create another wrapper function that calls your qsort and then will copy all data from the result into the original list and you are done. Something like: def qsort_in_place(L): sortedL=qsort(L) for (i,x) in enumerate(sortedL): L[i]=x Cheers, -Nick Vatamaniuc -- http://mail.python.org/mailman/listinfo/python-list

Re: Splitting a string

2007-05-15 Thread Nick Vatamaniuc
selected : employee">''' >>> s '\'D132258\\\',\\\'\\\',\n\\ \'status=no,location=no,width=630,height=550,left=200,top=100\\ \')"\ntarget="_blank" class="dvLink" title="Send an Email to selected \nemp

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Nick Vatamaniuc
ST 2007; root:xnu-792.18.15~1/RELEASE_I386 i386 i386 If you unpickle though will the results be the same? I suspect they will be. That should matter most of all (unless you plan to compare objects' identity based on their pickled version.) Remember, that by default pickle and cPickle will cr

Re: cPickle.dumps differs from Pickle.dumps; looks like a bug.

2007-05-16 Thread Nick Vatamaniuc
On May 16, 1:13 pm, Victor Kryukov <[EMAIL PROTECTED]> wrote: > Hello list, > > I've found the following strange behavior of cPickle. Do you think > it's a bug, or is it by design? > > Best regards, > Victor. > > from pickle import dumps > from cPickle import dumps as cdumps > > print dumps('100179

Re: RSA SecurID token authentication?

2007-05-31 Thread Nick Owen
ll allow you to use a third party radius server if you want and since all the two-factor vendors support radius, you won't have to re- write the apps if you switch strong authentication vendors. HTH, nick -- Nick Owen WiKID Systems, Inc. 404.962.8983 http://www.wikidsystems.com Commercial

Regular expression use

2007-08-24 Thread Nick Maclaren
hat is going on. Any pointers appreciated, to more-or-less anything. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Regular expression use

2007-08-24 Thread Nick Maclaren
many uses of Perl |> What exactly did you "hear" of several "uses"? Which |> application? Academia, Business, ...? Mainly academic research, but that still covers many fields. However, I am not and never have been a 'pure' academic, and am as interested in oth

How to set docstrings for extensions supporting PyNumberMethods?

2007-03-03 Thread Nick Alexander
m on the wrong list, please let me know! Thanks, Nick Alexander -- http://mail.python.org/mailman/listinfo/python-list

Re: How to set docstrings for extensions supporting PyNumberMethods?

2007-03-04 Thread Nick Alexander
gt;NickAlexander > > I think that the right way is to add the methods to the tp_methods > slot and use METH_COEXIST in the PyMethodDef flags field. Example: Ziga, thanks for an extremely helpful reply. I'll experiment and post again if there are issues. Cheers! Nick -- http://mail.python.org/mailman/listinfo/python-list

Re: Graphviz Python Binding for Python 2.5 on Windows?

2007-03-05 Thread Nick Vatamaniuc
utput. This way you don't have to install yapgvb or other adapters and it will work with Python 2.5. But you will need to compose your dot file as a giant character buffer... -Nick V. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is numeric keys of Python's dictionary automatically sorted?

2007-03-07 Thread Nick Vatamaniuc
On Mar 7, 3:49 pm, "John" <[EMAIL PROTECTED]> wrote: > Then is there anyway to sort the numeric keys and avoid future implemetation > confusion? > > "Ant" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > On Mar 7, 8:18 pm, "John" <[EMAIL PROTECTED]> wrote: > > ... > >> However,

Re: Bitpacked Data

2007-03-11 Thread Nick Vatamaniuc
gt;>> #note > means big endian >>> packed '\xca\xfe' >>> #oh, wow it spells cafe! ;-) >>> #now unpack >>> unpacked=unpack('>H',packed) >>> unpacked (51966,) >>> odata=unpacked[0] >>> vars=[] >>> for

Re: Watching a file another app is writing

2007-03-11 Thread Nick Vatamaniuc
On Mar 11, 3:36 pm, Gordon Airporte <[EMAIL PROTECTED]> wrote: > I'm trying to find a way to take a file that another program has opened > and writes to periodically, open it simultaneously in Python, and > automatically update some of my objects in Python when the file is > written to. > I can ope

import error

2007-03-16 Thread Nick Burns
Hi,   Quick question. I am running python on windows xp. i want to import my own module "mymod". However, when I try to import it i get the error message "ImportError: no module named mymod".   "mymod" is located in a directory that is part of the computer's "path" env variable. Imports fine if 'my

Re: urllib timeout issues

2007-03-27 Thread Nick Vatamaniuc
erver at a time so you still 'play nice' with each of the servers. If you want to have a max # of server threads running (in case you have way to many servers to deal with) then run batches of server threads. Hope this helps, Nick Vatamaniuc -- http://mail.python.org/mailman/listinfo/python-list

Re: Maths error

2007-01-10 Thread Nick Maclaren
reak b = c else : if c == a : break a = c That works in binary, but in no base above 2 (assuming that I haven't made a stupid error writing it down). In THAT case, it is easy to fix for decimal, but there are ways that it can show up that can be quite tricky to fix. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-10 Thread Nick Maclaren
ded programs. Yes, I know that it is a bit Irish for the best way to use a shared memory system to be to not share memory, but that's how it is. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-10 Thread Nick Maclaren
ith difficulty). Debugging and tuning OpenMP and POSIX threads are beyond anyone except the most extreme experts; I am only on the borderline of being able to. The ASCI bunch favour Co-array Fortran, and its model matches Python like a steam turbine is a match for a heart transplant. [*] They are worth looking up, if you don't know about them. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-10 Thread Nick Maclaren
e. They use it for the communication, but don't expose it to the programmer. It is therefore easy to put the processes on different CPUs, and get the memory consistency right. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-10 Thread Nick Maclaren
ONCEPTS in common between POSIX and C's memory consistency 'specifications' is perhaps the worst. That is why many POSIX threads programs work until the genuinely shared memory accesses become frequent enough that you get some to the same location in a single machine cycle. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-10 Thread Nick Maclaren
HPC system in UK academia for a decade, ending less than a year ago, incidentally, and was and am fairly well in touch with what is going on in HPC world-wide. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Maths error

2007-01-11 Thread Nick Maclaren
for a couple of decades. Indeed, a lot of modern programmers regard having to distort simple expressions in that way as anathema. It isn't a major issue, because our experience from then is that it is both teachable and practical, but it IS a way in which any base above 2 is significantly worse than base 2. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-11 Thread Nick Maclaren
and others forcing "consistency" (which is not actually defined, and there are many possible, incompatible, interpretations). It leaves all language aspects (including allowed code movement) to C. There are no concepts in common between C's and POSIX's consistency specifica

Re: Parallel Python

2007-01-11 Thread Nick Maclaren
n primitives, and threading models like OpenMP and BSP have explicit control. Also, MPI has asynchronous (non-blocking) communication. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-11 Thread Nick Maclaren
reasons why what seems to be a more heavyweight mechanism (message passing) can be faster than an apparently lightweight one (data sharing) are both subtle and complicated. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Rational Numbers

2007-01-11 Thread Nick Maclaren
- like rational, it would be straightforward to add to Python as an extension type. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Maths error

2007-01-12 Thread Nick Maclaren
e the last bit to 1. An old, cheap approximation to rounding. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Parallel Python

2007-01-12 Thread Nick Maclaren
st enough for real work by someone who is not deeply into developing Grid software, I will be amazed. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Tools Designing large/complicated applications

2007-01-12 Thread Nick Vatamaniuc
have a code generation application to take care of all the getters and setters. But of course if you have non-technical people who just know how to read UML diagrams, it makes sense to invest in a good design tool. Hope this helps, -Nick Carl J. Van Arsdall wrote: > For those of you that work

Re: Rational Numbers

2007-01-12 Thread Nick Maclaren
In article <[EMAIL PROTECTED]>, Carsten Haese <[EMAIL PROTECTED]> writes: |> On Thu, 2007-01-11 at 23:47 +, Nick Maclaren wrote: |> > In article <[EMAIL PROTECTED]>, |> > Facundo Batista <[EMAIL PROTECTED]> writes: |> > |> Noud Aldenhoven wrote

Re: Rational Numbers

2007-01-12 Thread Nick Maclaren
her one can replace the other, So far, so good. With reservations, I agree. |> but there are more use |> cases for Decimal than for Rational. That is dubious, but let's not start that one again. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Rational Numbers

2007-01-12 Thread Nick Maclaren
anipulated appropriately. Yes, I know that's "cheating" :-) Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Rational Numbers

2007-01-12 Thread Nick Maclaren
ATING-point helps with providing that, but that claim is extremely dubious. I can explain the problem in as much detail as you want, but would very much rather not. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Rational Numbers

2007-01-13 Thread Nick Maclaren
ow!". Oh, because it's not a proper data type! The data type is an expression, and is held in a structured form, of which such powers may be one level. This is better regarded as an optimisation of a common case than a true data type. Now, there MAY be such a language that supports such

Re: Maths error

2007-01-13 Thread Nick Maclaren
it was used on the old, discrete-logic, machines. I have been told by hardware people that implementing IEEE 754 rounding and denormalised numbers needs a horrific amount of logic - which is why only IBM do it all in hardware. And the decimal formats are significantly more complicated. What

Re: Rational Numbers

2007-01-13 Thread Nick Maclaren
t, but that claim is extremely dubious. |> > I can explain the problem in as much detail as you want, but would |> > very much rather not. |> |> Sorry, Nick, you might have to. ;-) |> |> I'm not educated in these matters, so I'd genuinely like to know why |>

Re: Maths error

2007-01-14 Thread Nick Maclaren
t of the base. So, at a wild guesstimate, 64-bit decimal will deliver a precision comparable to about 56-bit binary, and will cause significant numerical problems to a FEW applications. Hence people will have to convert to the much more expensive 128-bit decimal format for such work. Bloatware rules. All your bits are belong to us. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Maths error

2007-01-14 Thread Nick Maclaren
tware and throw a switch selecting between the two rounding rules. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Rational Numbers

2007-01-14 Thread Nick Maclaren
cent encapsulation. The decimal floating-point brigade grossly exaggerate the difficulty of doing that, in order to persuade people that their solution is better. If they admitted the difficulties of using decimal floating-point, and merely said "but, overall, we think it is a better solution

Fixed-point [was Re: Rational Numbers]

2007-01-14 Thread Nick Maclaren
an exception if a 1 ULP change in the floating- point number would give a different answer; this is needed to make certain operations reliable. The default formatting does the obvious thing :-) Er, that's about it Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Maths error

2007-01-15 Thread Nick Maclaren
applications. In 30 years, it has got almost nowhere. Don't confuse interval methods with interval arithmetic, because you don't need the latter for the former, despite the claims that you do. |> For people just getting into it, it can be shocking to realize just how |> wide the

Re: Maths error

2007-01-15 Thread Nick Maclaren
t; past an experiment. As the same is true for what plenty of people have done, despite them having good backgrounds in mathematics, don't feel inferior! Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Maths error

2007-01-16 Thread Nick Maclaren
oth the problem and global optimisation. This is why the "statistical" methods (so disliked by Kahan) are used. In a fair number of cases, they give reasonable estimates of the error. In others, they give a false sense of security :-( Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Class data members in C

2007-01-16 Thread Nick Maclaren
Hmm. The extensions documentation describes how to add instance members to a class (PyMemberDef), but I want to add a class member. Yes, this is constant for all instances of the class. Any pointers? Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Class data members in C

2007-01-17 Thread Nick Maclaren
ance... Oh, one of the first two - I am not bonkers! Changing a class after instance creation is guaranteed to cause confusion, if nothing else. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Number methods

2007-01-17 Thread Nick Maclaren
very easily provide the latter. Is there any documentation on the coercion function (nb_coerce)? It seems to have unusual properties. Thanks for any hints. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: Class data members in C

2007-01-18 Thread Nick Maclaren
nging instances. From a practical point of view I would |> say: "Just redefine it". But that is not very helpful. Specially if you are |> mucking about in C, as your title suggests... Thanks. As someone else posted, the answer is PyDict_SetItemString immediately after PyType_Ready. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: what can be used in a signal handler

2007-01-18 Thread Nick Maclaren
't be 100% reliable on all systems. Sorry. But that is the situation :-( Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find out if another process is using a file

2007-01-18 Thread Nick Maclaren
nyone who used MVS (which are NOT the ones claimed by the Unix brigade, which are mostly bogus) :-) Under Linux, you can do something with fuser, and I am pretty certain that modern Macintoshes (i.e. BSD) will have an equivalent. It can't be made reliable (unlike under MVS), but might reduce the number of problems. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to find out if another process is using a file

2007-01-18 Thread Nick Maclaren
_CREAT). I can't remember which - perhaps AIX or OSF/1 (not DEC). But I was referring to a different problem. Some remote and parallel filing systems handle such things very badly, and it is often possible to create a file even if it exists and O_CREAT|O_EXCL is set. A similar remark appl

Re: when format strings attack

2007-01-19 Thread Nick Maclaren
d find something, because the vulnerability |> is so well known for ages. Not really. There are LOTS of vulnerabilities that have been known for ages and are still legion. The reason that this is unlikely is that it is both easy to spot and trivial to fix. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

RE: OT Annoying Habits (Was: when format strings attack)

2007-01-19 Thread Nick Maclaren
lready deprecated. And top posting is only more convenient if you are merely adding a "me, too" or equivalent, and not responding in detail. But you have been told both of those before. Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

RE: OT Annoying Habits (Was: when format strings attack)

2007-01-20 Thread Nick Maclaren
the bottom. Rather like an appendix. But top-posting when you are responding to Email is as discourteous as top-posting when you are responding to newsgroups. |> So I concede the point, and I'm bottom-posting like a good citizen. =20 Excellent! Regards, Nick Maclaren. -- http://mail.python.org/mailman/listinfo/python-list

Re: The reliability of python threads

2007-01-24 Thread Nick Maclaren
|> safe or unsafe? Unsafe. They are built on top of unsafe primitives (POSIX, Microsoft etc.) Python will shield you from some problems, but not all. There is precious little that you can do, because the root cause is that the standards and specifications are hopelessly flawed. Regards, Nick Mac

Re: The reliability of python threads

2007-01-24 Thread Nick Maclaren
are flawed, not that the threads underneath you |> are buggy. I suggest that you find out rather more about the ill-definition of POSIX threading memory model, to name one of the better documented aspects. A Web search should provide you with more information on the ghastly mess t

<    4   5   6   7   8   9   10   11   12   13   >