Re: [Python-Dev] Handling of sys.args (Re: User's complaints)

2006-07-13 Thread Nick Maclaren
another argument for separating off argv[0] and allowing the program name to be None if there IS no program name. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761Fax

Re: [Python-Dev] Handling of sys.args (Re: User's complaints)

2006-07-14 Thread Nick Maclaren
7;t used systems with such features. Several systems have had the ability to exec to a memory segment, for example. But, yes. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH,

Re: [Python-Dev] Handling of sys.args (Re: User's complaints)

2006-07-15 Thread Nick Maclaren
off argv[0] and/or make that and the arguments read-only) is entirely different. That is purely a matter of convenience, cleanliness of specification or whatever you call it. I can't imagine any good reason to separate argv[0] from argv[1:] by a sandbox (either way). Regards, Nick Maclaren,

Re: [Python-Dev] Strategy for converting the decimal module to C

2006-07-19 Thread Nick Maclaren
But, regrettably, almost all exception handling on modern systems IS ghastly - at least by the standards of the 1960s. Whether you regard the use of Python for tuning code that is to be run using hardware, where the arithmetic will be performance- critical as important, is a matter of tast

Re: [Python-Dev] Strategy for converting the decimal module to C

2006-07-20 Thread Nick Maclaren
#x27;t saying that such things should be put into the API, merely that there is a very good reason to do so for hardware implementations and ones used to tune code for such implementations. Personally, I wouldn't bother. Regards, Nick Maclaren, University of Cambridge Computing Service

Re: [Python-Dev] new security doc using object-capabilities

2006-07-20 Thread Nick Maclaren
re-level ones. In practice, there is always some request that a sandbox can make to the hypervisor that can lock out or otherwise affect other sandboxes. The key is, of course, to admit that and to specify what is and is not properly virtualised, so that the consequences can at least be analysed.

Re: [Python-Dev] Strategy for converting the decimal module to C

2006-07-21 Thread Nick Maclaren
y corrupt critical registers when they think that it is safe. And few think of interrupts when deciding that So, in summary, please DON'T produce a design that relies on trapping floating-point exceptions and passing control to a Python function. This is several times harder than implement

Re: [Python-Dev] Strategy for converting the decimal module to C

2006-07-24 Thread Nick Maclaren
problems on memory) and device/timer interrupts. Once you add user-defined handlers into that mix, you either start exposing that mess to the program or have to implement them by stopping the CPU, unwinding the pipeline, and rerunning in very, very serial mode until the handler is called. Look at IA

Re: [Python-Dev] Strategy for converting the decimal module to C

2006-07-25 Thread Nick Maclaren
believe that both have such projects. IBM and Sun certainly do, though I don't know if IBM's is/are relevant. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAI

Re: [Python-Dev] Rounding float to int directly ...

2006-08-01 Thread Nick Maclaren
agree that controlled rounding in binary does not help with controlled rounding in decimal. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 12

Re: [Python-Dev] Rounding float to int directly ...

2006-08-01 Thread Nick Maclaren
formats to internal ones without loss of precision. Not a big deal, as there ARE no requirements for doing that for floating-point, and there are plenty of other solutions for fixed-point. People who care about the accuracy of calculations prefer binary, as it is a more accurate model. That isn't a b

Re: [Python-Dev] Rounding float to int directly ...

2006-08-01 Thread Nick Maclaren
ceptable. Yes, it can always be done, but only a few people are likely to do it correctly in all cases. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761

Re: [Python-Dev] Rounding float to int directly ...

2006-08-02 Thread Nick Maclaren
er (i.e. the reasons for wanting each are equally balanced). It all comes down to the simple question "Do we regard a single primitive for int(round()) as important enough to provide?" I abstain :-) Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pemb

Re: [Python-Dev] Rounding float to int directly ...

2006-08-02 Thread Nick Maclaren
t;, not "require" :-) For example, calculating the relative difference between two close numbers is sensitive to whether you are using the numbers in their normal or inverse forms (by a factor on N in base N), and this is a common cause of incorrect answers. A factor of 2 is better than o

Re: [Python-Dev] Rounding float to int directly ...

2006-08-03 Thread Nick Maclaren
rarer than the conversions to integer that are broken with both rules! And both are rarer than the code that works with either rule. However, a 5% breakage rate is still enough to be of concern. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, C

Re: [Python-Dev] Rounding float to int directly ...

2006-08-03 Thread Nick Maclaren
a float to an integer, held as a float. Which is independent of whether THIS particular facility should yield an integer or float! Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 122

Re: [Python-Dev] Rounding float to int directly ...

2006-08-03 Thread Nick Maclaren
truncates a float value, returning a float of the same type, on either functionality or efficiency grounds. I and most programmers of such algorithms don't give a damn which it does, provided that it is clearly documented, at least half-sane and doesn't change with versions of Python.

Re: [Python-Dev] Dicts are broken ...

2006-08-04 Thread Nick Maclaren
- been caught by that. It is a catastrophic (but very common) misdesign to conflate failure and the answer "no". There is a fundamental flaw of that nature in card-based banking, that I pointed out was insoluble to the Grid people, and then got caught by just a month later! Regards, Ni

Re: [Python-Dev] gcc 4.2 exposes signed integer overflows

2006-08-30 Thread Nick Maclaren
mple buffer overflow is fairly easy to avoid by good programming style; integer overflow causing trashing of unpredictable data isn't. Any decent programming language (like Python!) regards integer overflow as an error, and the moves to make C copy Java semantics are yet another step away fro

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-02 Thread Nick Maclaren
or Microsoft designs to support this, but currently they don't make it possible. There is NOTHING that Python can do but to minimise the chaos. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-02 Thread Nick Maclaren
d. The best solution is to enable the main thread for all relevant signals, disable all subthreads, but to not rely on any of that working in all cases. It won't help with the problem where merely receiving a signal causes chaos, or where blocking them does so, but there is nothing that Python c

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-04 Thread Nick Maclaren
Why would that help? The problems are semantic, not syntactic. Anthony Baxter isn't exaggerating the problem, despite what you may think from his posting. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-04 Thread Nick Maclaren
Chris McDonough <[EMAIL PROTECTED]> wrote: > > Would adding an API for sigprocmask help here? No. sigprocmask is a large part of the problem. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Em

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-04 Thread Nick Maclaren
s possible for a handler to be called with any of its critical pointers (INCLUDING the global code and data pointers) in undefined states? Do you know how to program round that sort of thing? I can answer "yes" to all three - for my sins, which must be many and grievous, for that to be

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-04 Thread Nick Maclaren
defers to C on what the C languages defines. So, even if the function is async-signal-safe, the code that calls it can't be! POSIX's lists are complete fantasy, anyway. Look at the one that defines thread-safety, and then try to get your mind around what exit being thread-safe actually

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-04 Thread Nick Maclaren
GUI fairly easily). As I say, this isn't so much a platform issue as a circumstance one. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761Fax: +44 1223 334679 __

[Python-Dev] Cross-platform math functions?

2006-09-05 Thread Nick Maclaren
a strong pointer to numerical problems. That viewpoint is regarded as heresy nowadays, but used not to be! Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761Fax: +

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-05 Thread Nick Maclaren
d decades later, because the pain threshhold never got high enough to dedicate the time (and the VERY few people with experience). I know of at least one such problem in generic TCP/IP (i.e. on Linux, IRIX, AIX and possibly Solaris) that has been there for decades and causes occasional failure in m

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-05 Thread Nick Maclaren
on signals for correct behaviour > should be rewritten to use unix sockets instead; end of argument. Er, no. There are lots of circumstances where that isn't feasible, such as wanting to close down an application cleanly when the scheduler sends it a SIGXCPU. Regards, Nick Maclaren, Universit

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-05 Thread Nick Maclaren
you be sure that the write will terminate fast enough to not cause time-critical code to fail? And have you studied the exact semantics of blocking on pipes? They are truly horrible. So this is NOT a matter of platform X is safe and platform Y isn't. Even Linux x86 isn't entirely

Re: [Python-Dev] Signals, threads, blocking C functions

2006-09-09 Thread Nick Maclaren
m afraid. The note starting "Darn" should be a LOT stronger :-) [ For example, think of two threads calling the function at exactly the same time, in almost perfect step. Oops. ] I can't honestly promise to put any time into this in the forseeable future, but will try (sometime).

Re: [Python-Dev] Caching float(0.0)

2006-09-29 Thread Nick Maclaren
, as the common cases that are not the above rarely account for enough of the numbers to be worth it. I did a fair amount of investigation looking for compressibility at one time, and that conclusion jumped out at me. The exact best choice depends entirely on what you are doing. Regards

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
olid grounds for believing that those claims are not based in fact, but are polemic. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761Fax: +44 1223 334679 __

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
ld get 60% of that saving at a small fraction of the cost and considerably greater generality. It isn't clear whether the effort justifies doing more. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAI

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
d differently. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761Fax: +44 1223 334679 ___ Python-Dev mailing list Py

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
ely badly into any normal programming language and are seriously incompatible with numeric validation, but Python adds more. Is there any other type where there are two values that are required to be different, but where both the hash is required to be zero and both are required to evaluate to False i

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
rom 0.0 isn't really in Python's current semantics at all. And, for reasons that we could go into, I assert that it should not be - which is NOT the same as not supporting branch cuts in cmath. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pemb

Re: [Python-Dev] Caching float(0.0)

2006-10-03 Thread Nick Maclaren
terion for deciding when to display -0.0 and 0.0. C99 is ambiguous to the point of internal inconsistency, except when __STDC_IEC_559__ is set to 1, though the intent is clear. And my reading of Python's code is that it relies on C's handling of such values. Regards, Nick Maclaren, Univ

Re: [Python-Dev] Caching float(0.0)

2006-10-04 Thread Nick Maclaren
That isn't always so - sometimes it merely means that you get wrong answers but no indication of that. > or see if it can't turn them off using the C99 APIs. That is a REALLY bad idea. You have no idea how broken that is, and what the impact it would be on Python. Regards, Nick Mac

Re: [Python-Dev] Caching float(0.0)

2006-10-04 Thread Nick Maclaren
ines, that's fine too). Firstly, see the above. Secondly, Python would need MAJOR semantic changes to conform to IEEE 754R. Thirdly, what would you say to the people who want reliable error detection on floating-point of the form that Python currently provides? Regards, Nick Maclaren, Univers

Re: [Python-Dev] Caching float(0.0)

2006-10-04 Thread Nick Maclaren
O LIA-1, LIA-2 and LIA-3 standards for floating-point arithmetic. atan2(0.0,0.0) should be an error. But C99 differs. While words do not fail me, they are inappropriate for this mailing list :-( Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Str

Re: [Python-Dev] Cloning threading.py using proccesses

2006-10-12 Thread Nick Maclaren
M.-A. Lemburg in IT! Some of the specialist systems, especially those used for communication, were like that, and it is very likely that many still are. But they aren't currently in Python's domain. I have never used any, but have colleagues who have. Regards, Nick Maclaren, University of Ca

Re: [Python-Dev] Cloning threading.py using proccesses

2006-10-12 Thread Nick Maclaren
way that POSIX (and Microsoft) threads have become essentially just processes with shared resources. If one had a system with real, lightweight threads, the same might well not be so. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2

Re: [Python-Dev] Signals, threads, blocking C functions

2006-10-12 Thread Nick Maclaren
s (yes, big SMPs) and blocking out high-priority interrupts. The efficiency point can be serious. ] That also applies to many of the signals that do not reach programs, such as TLB misses, ECC failure etc. But, in those cases, what does Python or even POSIX need to know about them? Regards, Ni

Re: [Python-Dev] Signals, threads, blocking C functions

2006-10-12 Thread Nick Maclaren
? No. It's not the only such problem. Personally, I think that anyone who calls system(), fork(), spawn() or whatever from threads is cuckoo. It is precisely the sort of thing that is asking for trouble, because there are so many ways of doing it 'right' that you can't be

Re: [Python-Dev] Floor division

2007-01-22 Thread Nick Maclaren
ain, losing information, raises an exception. The errors caused by needing a 'cast' (including Fortran INT, DBLE and (ugh) COMPLEX, here) causing not just conversion but information loss have caused major trouble for as long as I have been around. Regards, Nick Maclaren, University of

Re: [Python-Dev] Floor division

2007-01-23 Thread Nick Maclaren
de (incref `self` and return it). Eh? I don't understand. Are you referring to float("1.0e5"), pow(10,5), pow(10.0,5), or a conjugate (and, if so, of what?) float(conjg(1.23)) obviously need not raise an exception, except possibly "Sanity failure" :-) Regards, N

Re: [Python-Dev] Floor division

2007-01-23 Thread Nick Maclaren
ith the opposite > >> sign on the imaginary part, whether or not that equals 0 (+0. and -0. > >> both "equal 0"). > > |[Nick Maclaren] > > Grrk. Why? Seriously. > > Seriously: because there's some reason to do so and no good reason > not

[Python-Dev] Floor division

2007-01-23 Thread Nick Maclaren
is some way for a user to find that out. In the case of C, neither is true. > If not, there is no way to get robust and portable; it is just a > matter of which users you annoy. Well, actually, there is. Though I agree that the techniques have rather been forgotten in the past 30 years. Py

[Python-Dev] compex numbers (was Floor Division)

2007-01-23 Thread Nick Maclaren
g this (to discard the imaginary parts) would break > passing complex numbers to their own constructor. Eh? Now, I am baffled. There are several ways of changing it, all of which would turn one bizarre behaviour into another - or would raise an exception. Personally, I would do the following:

Re: [Python-Dev] Problem with signals in a single threaded application

2007-01-24 Thread Nick Maclaren
ble. Defending yourself against the other failures is an almost hopeless task, but luckily they are extremely rare except on specialist systems. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH,

[Python-Dev] Complex constructors [was Re: Floor division]

2007-01-24 Thread Nick Maclaren
der which the current behaviour adds any useful function over the one that raises an exception if there are two arguments and either is complex. Yes, of course, SOME people will find it cool to write complex(a,b) when they really mean a+1j*b, but Regards, Nick Maclaren, University of Cambridg

Re: [Python-Dev] Floor division

2007-01-25 Thread Nick Maclaren
nsive compared to its usefulness - especially with Decimal! But it isn't obviously WRONG. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 33476

Re: [Python-Dev] Floor division

2007-01-26 Thread Nick Maclaren
and also truncates. Yes. And that is clearly documented and not currently likely to change, as far as I know. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email:

Re: [Python-Dev] Floor division

2007-01-26 Thread Nick Maclaren
ssible to get more right than exactly right ;-) But, as a previous example of yours pointed out, it's NOT exactly right. It is also supposed to be in the range [0,y) and it isn't. -1%1e100 is mathematically wrong on two counts. 1a Cc: "Tim Peters" <[EMAIL PROTECTED]&g

Re: [Python-Dev] Floor division

2007-01-26 Thread Nick Maclaren
ng-point systems, and not rare on signed magnitude ones. During the standardisation of C90, the BSI tried to explain to ANSI that this needed spelling out, but were ignored. C99 did not add the normative text "(i.e., the value is truncated toward zero)" because there was no ambiguity, after

Re: [Python-Dev] Floor division

2007-01-26 Thread Nick Maclaren
sign > as x; Python's x.__mod__(y) has the same sign as y; and that makes all > the difference in the world as to whether the exact result is always > exactly representable as a float. Oops. You're right, of course. Regards, Nick Maclaren, U

[Python-Dev] Python's C interface for types

2007-01-26 Thread Nick Maclaren
to a single class, and returns a member of that class. Note that it specifically does NOT make sense on a single value of that class. Sorry about the length of this! Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, Engla

Re: [Python-Dev] Python's C interface for types

2007-01-26 Thread Nick Maclaren
standard > Python methods. I would suggest just making it a classmethod. > (dict.fromkeysis a good example of a classmethod in C.) Thanks. That is a useful reference. Reductions are a problem in many languages. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pemb

Re: [Python-Dev] Python's C interface for types

2007-01-26 Thread Nick Maclaren
hex/octal. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761Fax: +44 1223 334679 ___ Python-Dev mailing list Python-Dev@pytho

Re: [Python-Dev] Python's C interface for types

2007-01-26 Thread Nick Maclaren
". IEEE 754 has signed zeroes. And so it goes. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761Fax: +44 1223 334679 ___

Re: [Python-Dev] Python's C interface for types

2007-01-26 Thread Nick Maclaren
Josiah Carlson <[EMAIL PROTECTED]> wrote: > > See _PyLong_FromByteArray and _PyLong_AsByteArray . Oops! Thanks very much. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel

Re: [Python-Dev] Python's C interface for types

2007-01-26 Thread Nick Maclaren
d have no comments. Does that mean that they are unstable, in the sense that they may change behaviour in new versions of Python? And will they be there in 3.0? Thanks for any help, again. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, C

Re: [Python-Dev] Problem with signals in a single threaded application

2007-01-27 Thread Nick Maclaren
ld start on cross-CPU TLB and ECC handling on large shared memory systems. I managed to get an Origin in a state where it wouldn't even power down from the power-off button, and I had to flip breakers, due to THAT one! I have reason to believe that all largish SMP systems have similar problems.

Re: [Python-Dev] Python's C interface for types

2007-01-27 Thread Nick Maclaren
: "-0.0"} >>> print c[a], c[b] -0.0 -0.0 Well, we all know why. But it is not what some quite reasonable programmers will expect. And Decimal (with its cohorts and variant precisions) has this problem quite badly - as do I. No, I don't have an answer. You are damned if

[Python-Dev] Python's C interface for types

2007-02-01 Thread Nick Maclaren
Note that I am merely commenting that this needs bearing in mind, and NOT that anything should be changed. > >>>> a = float("+0.0") > >>>> b = float("-0.0") > >>>> print a, b > >0.0 -0.0 > > With the

Re: [Python-Dev] Python's C interface for types

2007-02-01 Thread Nick Maclaren
e 'C op' is a standard library function. This one is NOT going to go away, and is going to get more serious, especially if extended floating-point formats like Decimal take off. Note that it is not a fault in Decimal, but a feature of almost all extended floating-points. As I said, I

Re: [Python-Dev] Python's C interface for types

2007-02-01 Thread Nick Maclaren
things (to whom?), just keep going. Thanks. I hope the above clarifies things a bit. My purpose in posting is to point out that some changes are already happening, by inclusion from other standards, that are introducing problems to Python. And to many

[Python-Dev] Python's C interface for types

2007-02-02 Thread Nick Maclaren
op 0'. Both where op is a built-in > > operator and where 'C op' is a standard library function. > > That's fine; it just means that numeric equality may not be the > strongest possible equivalence. hash in particular just happens to be > defined in terms of ==,

Re: [Python-Dev] generic async io (was: microthreading vs. async io)

2007-02-15 Thread Nick Maclaren
ing transfers are undefined behaviour, whether in a single thread or in multiple threads. BSP uses this model. The MPI-2 design team included a lot of ex-mainframe people and specifies both models. While it is designed for parallel applications, the I/O per se is not controlled like threads. Reg

Re: [Python-Dev] generic async io (was: microthreading vs. async io)

2007-02-15 Thread Nick Maclaren
until a commit. If two transfers between a pair of commits overlap (including file length changes), the behaviour is undefined. All I/O includes its own positioning, and no positioning is relative. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, C

Re: [Python-Dev] generic async io (was: microthreading vs. async io)

2007-02-16 Thread Nick Maclaren
ata synchronously. The reason that a token is needed is to avoid a synchronous data copy that blocks both threads. My general point is that all experience is that asynchronous I/O is best done by separating it completely from threads, and defining a proper asynchronous but NOT threaded interfa

[Python-Dev] Class destructor

2007-02-28 Thread Nick Maclaren
something called when a class is destroyed. The obvious attempts all didn't work, in a variety of ways. Surely there must be a method? This could be in either Python or C. Thanks. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Ca

Re: [Python-Dev] Class destructor

2007-02-28 Thread Nick Maclaren
hat points to a block of memory that contains copies of all my workspace pointers, and use the object deallocator to clean up. If all else fails, I will try that, but it seems a hell of a long way round for what I would have thought was a basic requirement. Regards, Nick Maclaren, University o

Re: [Python-Dev] Class destructor

2007-02-28 Thread Nick Maclaren
#x27;t a technology I have used (in Python), so I would have to find out about them. Attributes etc. I have already played with. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED

Re: [Python-Dev] Class destructor

2007-03-02 Thread Nick Maclaren
dn't be adequate. In particular, THIS code doesn't need to do anything other than free memory, so I don't care whether the C object attribute callback is called before or after the class object is disposed of. But that is obviously not the case in general. Regards, Nick Maclaren

Re: [Python-Dev] Class destructor

2007-03-02 Thread Nick Maclaren
n for producing statistics. I haven't looked into it, as it is not an immediate task. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761Fax: +44 1

[Python-Dev] except Exception as err, tb [was: with_traceback]

2007-03-02 Thread Nick Maclaren
actually an object derived directly from the exception class, and everything becomes clear. Because it is an object, any context it includes was a snapshot and is no longer valid. In your case, you would want it to have "context: unknown". Regards, Nick Maclaren, University of Cambridge

Re: [Python-Dev] Access to bits for a PyLongObject

2007-03-06 Thread Nick Maclaren
a higher level of formatting, then I agree with you. So I have nailed my colours firmly to the fence :-) Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PR

Re: [Python-Dev] Status of thread cancellation

2007-03-19 Thread Nick Maclaren
ed memory segments. Even if the process dies cleanly, it may be part of an application whose state is global across many processes. One common example is adding or deleting a user, where an unclean kill can leave the system in a very weird state. Regards, Nick Maclaren, University of Cambrid

Re: [Python-Dev] Status of thread cancellation

2007-03-19 Thread Nick Maclaren
sn't going to do! The other effect that ordinary programmers notice is a system very gradually starting to run down after days/weeks/months of continual operation. The state is cleared by rebooting. Regards, Nick Maclaren. ___ Python-Dev mail

Re: [Python-Dev] Changes to decimal.py

2007-04-14 Thread Nick Maclaren
in the neck, and you really DON'T want to even contemplate a generic gamma function, let alone one of the beta functions :-( But none of this is specific to a decimal base, of course. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambr

Re: [Python-Dev] New operations in Decimal

2007-05-01 Thread Nick Maclaren
quot;or" are keywords, you can't have methods with those names: Am I losing my marbles, or is this a proposal to add the logical operations to FLOATING-POINT? I may have missed a previous posting, in which case I apologise, but this is truly mind-boggling. Regards, Nick Maclaren, Univ

Re: [Python-Dev] New operations in Decimal

2007-05-01 Thread Nick Maclaren
that specification built on top of a twos complement binary integer model is insanity squared. But promises are promises and mere insanity is not in itself an obstacle to political success I shall attempt to forget that I ever asked the question :-) Regards, Nick Maclaren, University of Camb

[Python-Dev] Regular expressions, Unicode etc.

2007-08-08 Thread Nick Maclaren
e able to reverse engineer the mechanism enough to get the files off the Unicode site and run it, but I don't want to spend forever on it. Any clues? Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EM

Re: [Python-Dev] Regular expressions, Unicode etc.

2007-08-08 Thread Nick Maclaren
7;s not helpful - people already know that, from the comments :-( Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761Fax:

Re: [Python-Dev] Regular expressions, Unicode etc.

2007-08-08 Thread Nick Maclaren
;? For basic ASCII and locale-based testing, whatever isprint() says. Just as for isalpha(). For Unicode, whatever people agree! I use the criterion that it has a defined category that doesn't start with 'C' - which is what I think that most people will accept. Regards, Nick Maclar

[Python-Dev] cc: "Martin v. Löwis"

2007-08-08 Thread Nick Maclaren
rebuild Python correctly. I couldn't be bothered to work out why, so I hit it with the usual trick, 'make distclean'. And, of course, it SHOULD be possible to upgrade the Unicode data without having to change version of Python! Regards, Nick Maclaren, University of Cambridge Computi

Re: [Python-Dev] Regular expressions, Unicode etc.

2007-08-08 Thread Nick Maclaren
d' by imposing a limit, but few people would be able to predict when it would bite. Thirdly, I would require notice of the question of whether capturing parentheses could be supported, and what semantic changes would be to which were set and how. Regards, Nick Maclaren, University of Cambridge

Re: [Python-Dev] Regular expressions, Unicode etc.

2007-08-08 Thread Nick Maclaren
t be called printing, and equally obviously controls shouldn't. There is no clear reason why the others should not be - especially as the difference between a modifying accent and a free-standing one is something so obscure that most people don't even know that there IS one. The point ab

Re: [Python-Dev] Unicode database

2007-08-09 Thread Nick Maclaren
r such things to 'escape' into Google. Have you checked whether or not that file is correct with the Unicode consortium? Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223

Re: [Python-Dev] Regular expressions, Unicode etc.

2007-08-09 Thread Nick Maclaren
rongly) on HP-UX, and the Java one, which I believe is a modified subset of the example in UTS#8. But that says: All syntax and API presented in this document is only for the purpose of illustration; there is absolutely no requirement to follow such syntax or API. Regards, Nick Maclaren,

Re: [Python-Dev] Regular expressions, Unicode etc.

2007-08-10 Thread Nick Maclaren
re not, alternative, approaches. What I said was correct - you cannot convert such extended expressions to DFAs. You can convert them to things that are sort of NFA/DFA hybrids, which might or might not be a good way to proceed. Regards, Nick Maclaren, University of Cambridge Computing Service

Re: [Python-Dev] Unicode database

2007-08-10 Thread Nick Maclaren
suitable proposal that, inter alia, includes changes that can't be made by the normal building mechanisms. And I still don't have a clue about that one. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [E

Re: [Python-Dev] Regular expressions, Unicode etc.

2007-08-10 Thread Nick Maclaren
ccept. That is equivalent to the definition you gave. Regards, Nick Maclaren, University of Cambridge Computing Service, New Museums Site, Pembroke Street, Cambridge CB2 3QH, England. Email: [EMAIL PROTECTED] Tel.: +44 1223 334761Fax: +44 1223 334679

Re: [Python-Dev] New lines, carriage returns, and Windows

2007-09-29 Thread Nick Maclaren
til and unless Python chooses to define its own I/O model, these problems will continue to arise. Whether this one is a simple bug or an avoidable feature, I can't say without looking harder, but bugs are often caused by attempting to implement impossible or confusing specifications. Reg

Re: [Python-Dev] New lines, carriage returns, and Windows

2007-09-29 Thread Nick Maclaren
#x27;t see that changing in the forseeable future. > Legacy OSes are called that for a reason. Well, I remember when the text I/O model that C, Unix and Python use WAS a feature of legacy OSs :-) Seriously. Regards, Nick Maclaren, University of Cambridg

Re: [Python-Dev] [python] Re: New lines, carriage returns, and Windows

2007-09-30 Thread Nick Maclaren
associated property. Note that the above is what the program sees - what is written to the outside world and how input is read is another matter. But I can assure you, from my own and many other people's experience, that neither of the above models cause the confusion being shown by the pos

Re: [Python-Dev] New lines, carriage returns, and Windows

2007-09-30 Thread Nick Maclaren
? Think about MacOS here. I could go on, but those are enough to indicate that the problem is insoluble. The answer "Undefined but not even explicitly discouraged" is a recipe for confusion. Regards, Nick Maclaren, University of Cambridge Computin

Re: [Python-Dev] New lines, carriage returns, and Windows

2007-09-30 Thread Nick Maclaren
u don't need to write portable formatting. 2) The 'outside system' uses the control characters of a byte stream for formatting. Let's skip (1) - but (2) is universally true, nowadays, isn't it? Er, no. Consider reading and writing to an X window (NOT an xterm). Suc

  1   2   >