[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Cameron Simpson
e the length of the string before and after. If the lengths are the same, nothing was removed. Aye. Cheers, Cameron Simpson ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.py

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Cameron Simpson
/is-not b" as overly prescriptive; returning the same reference as one is given seems nearly the easiest thing a function can ever do. Cheers, Cameron Simpson ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to pyt

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Cameron Simpson
On 21Mar2020 14:40, Eric V. Smith wrote: On 3/21/2020 2:09 PM, Steven D'Aprano wrote: If you want to know whether a prefix/suffix was removed, there's a more reliable way than identity and a cheaper way than O(N) equality. Just compare the length of the string before and after. If the lengths

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-21 Thread Cameron Simpson
cut off and discarded, and it is clearly different from "strip". Please, NO. "trim" is a VERY well known PHP function, and does what our strip does. I've very against this (otherwise fine) word for this reason. I still pref

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-22 Thread Cameron Simpson
mind they are quite different, which is the basis of my personal dislike of reusing the word "strip". Just extending "strip()" with a funky new affix mode would be even worse, since it can _still_ be misleading if the caller omited the special mode. Cheers, Cameron Simpson

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-23 Thread Cameron Simpson
g. That surprises me too. I expect the first matching affix to be used. It is the only way for the caller to have a predictable policy. As a diversion, _are_ there use cases where an empty affix is useful or reasonable or likely? Cheers, Cameron Simpson

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-25 Thread Cameron Simpson
module name back from __str__ I'd be underwhelmed. I think I'd at least like the behaviour switchable in some way. Cheers, Cameron Simpson ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@py

[Python-Dev] Re: Enum._convert should change __repr__ and/or __str__ to use module name instead of class name

2020-03-25 Thread Cameron Simpson
On 26Mar2020 00:35, Serhiy Storchaka wrote: 26.03.20 00:08, Cameron Simpson пише: I think a more "Python normal" module might have multiple enum classes, maybe with overlapping names. Do you have any examples of more "Python normal" modules? Unfortunately no becaus

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-25 Thread Cameron Simpson
reiterate my huge -1 on "trim" because it will confuse every PHP user who comes to us from the dark side. Over there "trim" means what our "strip" means. I've got (differing) opinions about the others, but "trim" is a big one to me. Cheers, Ca

[Python-Dev] Re: PEP 616 -- String methods to remove prefixes and suffixes

2020-03-25 Thread Cameron Simpson
rule system, which prioritised rules by the lexical length of their regexp, not their config file order of appearance. That way lies (and, indeeed, lay) madness. Cheers, Cameron Simpson ___ Python-Dev mailing list -- python-dev@python.org To unsubscrib

[Python-Dev] Re: Improvement to SimpleNamespace

2020-04-14 Thread Cameron Simpson
ath through the JSON module seems... clunky. Cheers, Cameron Simpson ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archiv

[Python-Dev] Re: Improvement to SimpleNamespace

2020-04-15 Thread Cameron Simpson
On 14Apr2020 23:08, Glenn Linderman wrote: On 4/14/2020 10:09 PM, Cameron Simpson wrote: Like many others, I recently implemented one of these __getattr__+__getitem__ SimpleNamespaces.  I'm hacking on some mappings which map dotted-names to values.  So the natural implementation is dic

[Python-Dev] Re: PoC: Subinterpreters 4x faster than sequential execution or threads on CPU-bound workaround

2020-05-06 Thread Cameron Simpson
ll in the one memory space. Cheers, Cameron Simpson ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at htt

[Python-Dev] for Glenn Linderman Re: Re: Improvement to SimpleNamespace

2020-05-07 Thread Cameron Simpson
seems to have a personal dislike for me, and I'm fearing something similar may be at play for you. Again, my apologies to other list members. Thanks, Cameron Simpson ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email

[Python-Dev] Re: Map errno==ETIME to TimeoutError

2020-05-24 Thread Cameron Simpson
nyway, I'd like to know how this might affect try/except setups, particularly ones like the above which expect to catch a class of error and differentiate amongst them. I am not against the issue suggest though. Cheers, Cameron Simpson On 24May2020 14:59, Gregory P. Smith wrote: Sound

[Python-Dev] docs: I'd like new features to references their PEPs

2020-09-13 Thread Cameron Simpson
;, it also said "specified by PEP424 [link]", since I had to go find that with a search engine to understand the rationale. Would PRs with such patches be welcome? Cheers, Cameron Simpson ___ Python-Dev mailing list -- python-dev@python.org To uns

[Python-Dev] Re: docs: I'd like new features to references their PEPs

2020-09-13 Thread Cameron Simpson
On 13Sep2020 20:51, Guido van Rossum wrote: >On Sun, Sep 13, 2020 at 8:12 PM Cameron Simpson wrote: >> As a concrete example, for __length_hint__ and operator.length_hint, >> I >> wish that in addition to saying "New in version 3.4", it also said >> "s

[Python-Dev] Re: docs: I'd like new features to references their PEPs

2020-09-14 Thread Cameron Simpson
now, the devguide has the details including for the inline markup role :pep:. > >https://devguide.python.org/documenting/#rest-inline-markup Thanks Ned. - Cameron Simpson ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send

[Python-Dev] Re: docs: I'd like new features to references their PEPs

2020-09-14 Thread Cameron Simpson
On 14Sep2020 18:17, Terry Reedy wrote: >On 9/14/2020 5:25 AM, Cameron Simpson wrote: >>On 14Sep2020 01:16, Ned Deily wrote: >>>My suggestion would be to open one BPO issue for "adding PEP >>>references to documentation" and then creating PRs as needed again

[Python-Dev] Re: docs: I'd like new features to references their PEPs

2020-09-15 Thread Cameron Simpson
On 14Sep2020 18:17, Terry Reedy wrote: >On 9/14/2020 5:25 AM, Cameron Simpson wrote: >>On 14Sep2020 01:16, Ned Deily wrote: >>>>I'll make some PRs. How to submit? Here, or a BPO or something? >>> >>>My suggestion would be to open one BPO issue for &quo

[Python-Dev] Re: [python-committers] Thank you Larry Hastings!

2020-10-06 Thread Cameron Simpson
On 05Oct2020 22:14, Tal Einat wrote: >You have my thanks as well, Larry. And mine. - Cameron Simpson ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailm

Re: [Python-Dev] Ext4 data loss

2009-03-10 Thread Cameron Simpson
o disc regularly (or frequently, at any rate) anyway. What's too big a window of potential loss? For myself, I'm against libraries that implicitly do fsyncs, especially if the user can't issue policy about it. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ If

Re: [Python-Dev] Ext4 data loss

2009-03-10 Thread Cameron Simpson
On 10Mar2009 22:14, A.M. Kuchling wrote: | On Wed, Mar 11, 2009 at 11:31:52AM +1100, Cameron Simpson wrote: | > On 10Mar2009 18:09, A.M. Kuchling wrote: | > | The mailbox module tries to be careful and always fsync() before | > | closing files, because mail messages are pretty

Re: [Python-Dev] Ext4 data loss

2009-03-10 Thread Cameron Simpson
hand to os.fsync() et al. Having sync() and datasync() methods in the object would obviate the need for the caller to know the object internals. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ I must construct my own System, or be enslaved to another Man&#

Re: [Python-Dev] Ext4 data loss

2009-03-11 Thread Cameron Simpson
nc, probably because it really is only feasible to say "get to a particular checkpoint in the journal". Many other filesystems will have similar degrees of granularity, perhaps not all. Anyway, fsync is a much bigger ask than close, and should be used very sparingly. Cheers, -- Cameron

Re: [Python-Dev] Python-Dev] wait time [was: Ext4 data loss

2009-03-12 Thread Cameron Simpson
dge the data before the medium has completed updating. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Isaac Asimov once remarked that friends had chided him for not patenting the electronic pocket calculator, since he wrote of similar devices back in the 1940's. His re

Re: [Python-Dev] Python-Dev] wait time [was: Ext4 data loss

2009-03-12 Thread Cameron Simpson
with a clear conscience. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ DRM: the functionality of refusing to function. - Richard Stallman ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listin

Re: [Python-Dev] Proposed addtion to urllib.parse in 3.1 (and urlparse in 2.7)

2009-04-12 Thread Cameron Simpson
_ and append_ methods with set and list behaviour. Feels a little like API bloat, though the convenience function can be nice. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ The wonderous pulp and fibre of the brain had been substituted by brass and iron; he had taught w

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread Cameron Simpson
like using Python2 for that. Finally, I have a small python program whose whole purpose in life is to transcode UNIX filenames before transfer to a MacOSX HFS directory, because of HFS's enforced particular encoding. What approach should a Python app take to transcode UNIX pathnames under your s

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread Cameron Simpson
e-byte stuff to be off in the "posix" module if os.* goes pure character instead of bytes or bytes+strings. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ ... that, in a few years, all great physical constants will have been approximately estimated, and that the only occu

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-23 Thread Cameron Simpson
understand from the rest of your message what |would *actually* break if people would use the proposed interfaces. My other longer message describes what would break, if I understand your proposal. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ __

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-24 Thread Cameron Simpson
that the API uses C strings, which are NUL terminated. So, yes, you could use NUL as an escape character if you're sure you're never dealing with _non_POSIX pathnames:-) Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ | I'm the female partner of a climber (

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-25 Thread Cameron Simpson
On 25Apr2009 14:07, "Martin v. Löwis" wrote: | Cameron Simpson wrote: | > On 22Apr2009 08:50, Martin v. Löwis wrote: | > | File names, environment variables, and command line arguments are | > | defined as being character data in POSIX; | > | > Specific citation plea

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-27 Thread Cameron Simpson
nism that uses displayable characters would have > an advantage there. Wouldn't any escaping mechanism that uses displayable characters require visually mangling occurences of those characters that legitimately occur in the original? -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-27 Thread Cameron Simpson
elucidate the "second source" of strings. I'm presuming you mean strings egenrated from scratch rather than obtained by something like listdir(). Given such a string with "funny invalid" stuff in it, and _absent_ Martin's scheme, what do you expect the source o

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-27 Thread Cameron Simpson
thing that failed. Yes, they would. Are you doing that on a real UNIX filesystem (ext2/3/4, XFS etc)? I'm not sure whether you're arguing for or against the propsal here, btw. This would make a file with a presumably UTF-8-invalid name. Martin's proposal would cheerfully map th

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-27 Thread Cameron Simpson
h cleanly takes unicode (I gather) but perhaps handy for people hacking filesystems directly or something like that. (Except I gather from a former existence that there is a multitude of on-disk filename encoding under WIndows depending how old your filesystems are and if they're FAT or N

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-27 Thread Cameron Simpson
t;second source" of strings. I'm presuming you mean >> strings egenrated from scratch rather than obtained by something like >> listdir(). >> > > POSIX has byte APIs for strings, that's one source, that is most under > d

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-27 Thread Cameron Simpson
On 27Apr2009 21:58, Benjamin Peterson wrote: | 2009/4/27 Cameron Simpson : | > PROPOSAL: add to the PEP the following functions: [...] | > and for me, I would like to see: | >  os.setfilesystemencoding(coding) | > | > Currently os.getfilesystemencoding() returns you the encoding b

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-28 Thread Cameron Simpson
I think I may be able to resolve Glenn's issues with the scheme lower down (through careful use of definitions and hand waving). On 27Apr2009 23:52, Glenn Linderman wrote: > On approximately 4/27/2009 7:11 PM, came the following characters from > the keyboard of Cameron Simpson: [..

Re: [Python-Dev] Python-Dev PEP 383: Non-decodable Bytes in System Character?Interfaces

2009-04-28 Thread Cameron Simpson
perform: os-bytes->funny-encoded funny-encoded->os-bytes or explicit example code snippets for same in the PEP text. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ This person is currently undergoing electric shock therapy at Agnews Developmental Center in San Jose,

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-28 Thread Cameron Simpson
equire some app care for particular very weird strings that don't come from the filesystem, but as far as I can see only in circumstances where such care would be needed anyway i.e. you've got to do special stuff for weirdness in the first place. Weird == "ill-formed unicode string&

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-28 Thread Cameron Simpson
#x27;m more concerned with your (yours? someone else's?) mention of shift characters. I'm unfamiliar with these encodings: to translate such a thing into a Latin example, is it the case that there are schemes with valid encodings that look like: [SHIFT] a b c which would produce "

Re: [Python-Dev] Python-Dev PEP 383: Non-decodable Bytes in System Character?Interfaces

2009-04-29 Thread Cameron Simpson
On 29Apr2009 08:27, Martin v. L?wis wrote: | > I would like utility functions to perform: | > os-bytes->funny-encoded | > funny-encoded->os-bytes | > or explicit example code snippets for same in the PEP text. | | Done! Thanks! -- Cameron Simpson DoD#743 http://www.cskk.

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-29 Thread Cameron Simpson
27;re seeing an artifact; did python move from UNIX to Windows or the other way around in its porting history? I'd guess the former. Do you get differing results from listdir(".") and listdir(b".") ? How's python2 behave for ""? (Since there's no b"

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-29 Thread Cameron Simpson
I believe is just not >> there). >> >> Well, here's another one: PEP 383 would disallow UTF-8 encodings of >> half surrogates. > > By my reading, the current Unicode 5.1 definition of 'UTF-8' disallows that. 5.0 also disallows it. No surprise I guess. -- Ca

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-29 Thread Cameron Simpson
ding anyway, at least to some extent, and thus not trip over the PEP? -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Clemson is the Harvard of cardboard packaging. - overhead by WIRED at the Intelligent Printing conference Oct2006 ___ Pytho

Re: [Python-Dev] PEP 383: Non-decodable Bytes in System Character Interfaces

2009-04-29 Thread Cameron Simpson
ning from rare illegal strings to merely uncommon but legal characters. - Some parties think it would be better to not return strings from os.listdir but a subclass of string (or at least a duck-type of string) that knows where it came from and is also handily recognisable as

Re: [Python-Dev] PEP 383 and GUI libraries

2009-05-01 Thread Cameron Simpson
r, his assertion/hope is true only if srcencoding == 'utf-8'. The PEP itself says that it works if the decode and encode use the same mapping. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ "How do you know I'm Mad?" asked Alice. "You must be,&qu

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-12 Thread Cameron Simpson
(never having used peek()), my own desire would normally be for a peek(n, block=False) a bit like Queue.get(). Then I could be sure not to block if I wanted to avoid it, even on a blocking stream, yet still obtain unread buffered data if present. So: what do people use peek() for, mostly? Cheer

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-13 Thread Cameron Simpson
t to see if there's stuff in the buffer _without_ doing any raw reads at all. A peek0(n), if you will: Read and return up to n bytes without calling on the raw stream. It feels like peek is trying to span both extremes and doesn't satisfy either really well. If peek gets enhanced to act l

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-13 Thread Cameron Simpson
On 14Jun2009 15:16, I wrote: | Is it possible to access the buffer? I see nothing in the docs. I've just found getvalue() in IOBase. Forget I said anything. It seems to be my day for that kind of post:-( -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ These are but

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-14 Thread Cameron Simpson
On 14Jun2009 09:21, Benjamin Peterson wrote: | 2009/6/14 Cameron Simpson : | > On 14Jun2009 15:16, I wrote: | > | Is it possible to access the buffer? I see nothing in the docs. | > | > I've just found getvalue() in IOBase. Forget I said anything. | > It seems to be my day f

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-14 Thread Cameron Simpson
ad of a Queue I'd want to poll for "buffer empty". If there isn't an empty buffer I know there will be a packet worth of data coming immediately and I can pick it up with regular read()s, just as I'm doing with Q.get() above. But if the buffer is empty I can drop

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-15 Thread Cameron Simpson
On 16Jun2009 11:21, Greg Ewing wrote: > Cameron Simpson wrote: >> It seems like whenever I want to do some kind of opportunistic but >> non-blocking stuff with a remote service > > Do you actually do this with buffered streams? Sure, in C, python and perl quite happily.

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-15 Thread Cameron Simpson
My concerns would go away if I could probe the buffer content size; then I could ensure peek(n) chose n <= the content size. If that's not enough, my problem - I can choose to read-and-block or go away and come back later. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ If al

Re: [Python-Dev] Avoiding file descriptors leakage in subprocess.Popen()

2009-06-15 Thread Cameron Simpson
try/except at least closes things as control passes out of the relevant scope. I don't think all pythons do immediate ref-counted GC. But it's very neat! -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Trust the computer industry to shorten Year 2000 to Y2K. It was this think

Re: [Python-Dev] io.BufferedReader.peek() Behaviour in python3.1

2009-06-16 Thread Cameron Simpson
On 17Jun2009 10:55, Greg Ewing wrote: > Cameron Simpson wrote: >> I normally avoid >> non-blocking requirements by using threads, so that the thread gathering >> from the stream can block. > > If you have a thread dedicated to reading from that > stream, then I don&#

Re: [Python-Dev] pthreads, fork, import, and execvp

2009-09-10 Thread Cameron Simpson
pect to the upcoming Python 2.6.3? -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Life is pleasant. Death is peaceful. It's the transition that's troublesome. - Isaac Asimov ___ Python-Dev mailing list Python-Dev@python.org htt

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Cameron Simpson
for methods that produce addresses! | If I want just an IPAddress object, then I can | always fetch the "ip" attribute to get that. Perhaps there is some | compelling conceptual argument as to why this is not correct, but it | seems like the API destroys information needlessly. I really think

Re: [Python-Dev] PEP 3144 review.

2009-09-19 Thread Cameron Simpson
0] | returns. Yes, I think Eric was complaining about the name being "network", since we have Network objects and this isn't one. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ ___ Python-Dev mailing list Python-De

Re: [Python-Dev] PEP 389: argparse - new command line parsing module

2009-09-28 Thread Cameron Simpson
it's a vote for availability of the sequence-of-letters style. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ The most annoying thing about being without my files after our disc crash was discovering once again how widespread BLINK was on the web. __

Re: [Python-Dev] Reworking the GIL

2009-10-26 Thread Cameron Simpson
though. +1 to both sentences from me. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Plague, Famine, Pestilence, and C++ stalk the land. We're doomed! Doomed! - Simon E Spero ___ Python-Dev mailing list Python-Dev@python.o

Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-11-01 Thread Cameron Simpson
xpensive, might easily return the same element to every caller. Do anyone feel an iteration capable .get() unduely burdens subclasses that want to impement different .get()s? Both the suggested potential subclass choices (round robin and random) suggest iteration capable .get()s (presuming "

Re: [Python-Dev] Python-Dev Retrieve an arbitrary element from a set?withoutremoving it

2009-11-02 Thread Cameron Simpson
On 02Nov2009 10:21, Antoine Pitrou wrote: | Cameron Simpson zip.com.au> writes: | > | > Personally, I'm for the iteration spec in a lot of ways. | > | > Firstly, a .get()/.pick() that always returns the same element feels | > horrible. Is there anyone here who _likes_ i

Re: [Python-Dev] Retrieve an arbitrary element from a set withoutremoving it

2009-11-03 Thread Cameron Simpson
On 04Nov2009 09:46, Steven D'Aprano wrote: | On Tue, 3 Nov 2009 09:19:38 am Greg Ewing wrote: | > Cameron Simpson wrote: | > > Personally, I'm for the iteration spec in a lot of ways. For the record, I've since, in mere hours or day, been convinced my preference was misgu

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-25 Thread Cameron Simpson
on other Pythons. I know this is a slightly thin objection, since your change can probably be taken to the other implementations. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ But pessimism IS realism! - D.L.Bahr ___ Python-Dev

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Cameron Simpson
plementation (i.e. the base offset this pop(0) opt would incur, which adds a (small) cost to everything). The other aspect, mentioned elsewhere in this thread, is that programmers should know the O() cost of these operations. Cheers, -- Cameron Simpson DoD#743 http://www.cskk

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-27 Thread Cameron Simpson
On 27Jan2010 23:08, Nick Coghlan wrote: | Cameron Simpson wrote: | > The proposed change to make pop(0) O(1) involves adding a base offset | > to the internal list implementation. Doesn't that incur a (small) | > overhead to _every_ list operation? Doesn't that weaken &q

Re: [Python-Dev] "Fixing" the new GIL

2010-03-13 Thread Cameron Simpson
nt anyway; I can't fairly claim to have had it cause me trouble yet. (Indeed, I've not used the new GIL at all - it's mostly using python 2.6). Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ I very strongly suggest that you periodical

Re: [Python-Dev] "Fixing" the new GIL

2010-03-15 Thread Cameron Simpson
ued which work for a substantial time, and meanwhile a bunch of tiny tiny cheap requests arrive. Their timely response will be impacted by this issue. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ hybrid rather than pure; compromising rather than clean; distorted rather t

Re: [Python-Dev] "Fixing" the new GIL

2010-03-15 Thread Cameron Simpson
omewhat in parallel. Here one can get a compute bound thread answering one request, impacting quick response to other parallel-and-cheap requests. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Here was a man who not only had a ready mind and a quick wit, but could also si

Re: [Python-Dev] "Fixing" the new GIL

2010-03-16 Thread Cameron Simpson
On 16Mar2010 08:59, "Martin v. Löwis" wrote: | Cameron Simpson wrote: | > On 15Mar2010 09:28, Martin v. L�wis wrote: | > | > As for the argument that an application with cpu intensive work being | > | > driven by the IO itself will work itself out... No it won't

Re: [Python-Dev] "Fixing" the new GIL

2010-03-16 Thread Cameron Simpson
he tasks blocked waiting for something to happen get to run more immediately when an event does occur, you tend to get better "responsiveness". Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Be smart, be safe, be paranoid.

Re: [Python-Dev] PEP 3147, __pycache__ directories and umask

2010-03-22 Thread Cameron Simpson
se an exception or refuse to create __pycache__ if it's not writable | (again, by whom?) -3 Bleah. My python program won't run because an obscure (to the user) directory had unusual permissions? Tough ove, it's the only way:-) -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs

Re: [Python-Dev] PEP 3147, __pycache__ directories and umask

2010-03-22 Thread Cameron Simpson
eption. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ The govt MUST regulate the Net NOW! We can't have average people saying what's on their minds! - ezwri...@netcom.com ___ Python-Dev mailing list P

Re: [Python-Dev] Python 2.7b1 and argparse's version action

2010-04-18 Thread Cameron Simpson
ortcut for "--version" looks wrong, though. | "-v" is almost always used for verbosity these days. My view is the same. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ By dint of railing at idiots one runs the risk of becoming idiotic oneself. - Gustave F

Re: [Python-Dev] argparse ambiguity handling

2010-04-20 Thread Cameron Simpson
is the simple and obvious and commonly wanted mode and --foo-tweak is a special case. Real world example: rsync and the --delete* options. I'm sure plenty of others can be found. The new behaviour makes this doable. The old behaviour made it unimplementable. Maybe it i

Re: [Python-Dev] Possible patch for functools partial - Interested?

2010-05-11 Thread Cameron Simpson
ky here about intent, especially since a few messages in the thread is contemplate testing function for equivalence to one degree or other. At which point "==" and "is" aren't the same any more. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Car

Re: [Python-Dev] Reasons behind misleading TypeError message when passing the wrong number of arguments to a method

2010-05-20 Thread Cameron Simpson
ishly printed their repr in debug statements. They can be... wordy. Maybe a cropped repr, or the .__class__ attribute? -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Every technical corrigendum is met by an equally troublesome new defect report. - Norman Di

Re: [Python-Dev] PEP 3148 ready for pronouncement

2010-05-23 Thread Cameron Simpson
asynchronous modes for future possibly-concurrent execution, just as the futures module does. I've spent a _lot_ of time debugging it. There's a lot to be said for a robust implementation of a well defined problem. Brian's module, had it been present and presuming it robust and debug

Re: [Python-Dev] mkdir -p in python

2010-07-20 Thread Cameron Simpson
uggestion too? Disclaimer: I am _not_ a dev. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ I am not a free man, I am a number. - Beirne Konarski ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/ma

Re: [Python-Dev] Update Shell profile for ZSH on Mac OS

2010-08-27 Thread Cameron Simpson
nt setup should live and is not what should be used in this patch. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Shape without form, shade without colour, Paralysed force, gesture without motion;- T.S. Eliot, _The Hollow Men_ __

Re: [Python-Dev] Goodbye

2010-09-22 Thread Cameron Simpson
sing a lot of bugs that most devs don't think should be closed and could not be dissuaded from doing so I can't see an alternative. I'm just saying I think the tone if his responses in the thread cited isn't as negative to my eye as people are making out. Cheers, -- Cameron Simp

Re: [Python-Dev] Inclusive Range

2010-10-03 Thread Cameron Simpson
. 2: -1; the current behaviour is, IMHO, highly desirable. Example: x=3; y=7; z=12 s='ahahahahahahahaha' assert s[:x]+s[x:y]+s[y:z]+s[z:] == s No icky +1 hacks in there. 3: I find myself doing the +1 thing very _un_often, myself. Cheers, -- Cameron Simpson Do

Re: [Python-Dev] gc ideas -- sparse memory

2010-12-03 Thread Cameron Simpson
needs no papping or extra storage. Of course, it removes certain freedoms from the GC etc as a side effect. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ The number of cylinders for this disk is set to 364737. There is nothing wrong with that, but this is larger than

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Cameron Simpson
cases and probably an example of diff friendliness: x = f(a, b=3, ##c=4, hacking at dev time d=5) Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ A Master is someone who started before you did. - Gary Zukav

Re: [Python-Dev] Mercurial conversion repositories

2011-02-25 Thread Cameron Simpson
r Mercurial so you could do the usual "hg commit" command without going through the outer wrapper. I'll devote a little time today, since I've missed this little hack:-( Interested? Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ We don't just *borro

Re: [Python-Dev] In-Python virtualisation and packaging

2011-06-13 Thread Cameron Simpson
son. Same issue with "capsules" (yes I know you weren't serious) - too generic a term, too vague. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ It looked good-natured, she thought; Still it had very long claws and a great many teeth, so she felt it ough

Re: [Python-Dev] In-Python virtualisation and packaging

2011-06-13 Thread Cameron Simpson
over the modules trees looking for identical module files to hard link and if you've got several kernels lying around it is unforgivably slow. Or maybe it loads the package install db into memory and does something expensive to see what's not accounted for. [ end speculation, but nothi

Re: [Python-Dev] Import lock considered mysterious

2011-07-22 Thread Cameron Simpson
but before executing the module body? Sometimes names are made by executing the module body. Since one expects to access the module's names after the import, how is this avoidable? Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ What's the point of having

Re: [Python-Dev] on Python's tests (and making them better)

2008-06-06 Thread Cameron Simpson
th the lack of hierarchical directories. Aye, but I've frequently tripped over people blithely saying "general to specific" for nesting without realising that the axes were orthoganal, not inherently nested. Not arguing for or against, btw. -- Cameron

Re: [Python-Dev] fileobj.read(float): warning or error?

2008-07-21 Thread Cameron Simpson
converstion, shouldn't read() raise an exception if asked for < 1 bytes? Or is there a legitimate use for read(0) with which I was not previously aware? -- Cameron Simpson <[EMAIL PROTECTED]> DoD#743 http://www.cskk.ezoshosting.com/cs/ _

Re: [Python-Dev] fileobj.read(float): warning or error?

2008-07-22 Thread Cameron Simpson
On 22Jul2008 20:56, John J Lee <[EMAIL PROTECTED]> wrote: > On Tue, 22 Jul 2008, Cameron Simpson wrote: > [...] >> Leaving aside the 0.2 => 0 converstion, shouldn't read() raise an >> exception if asked for < 1 bytes? Or is there a legitimate use for read(0)

Re: [Python-Dev] fileobj.read(float): warning or error?

2008-07-22 Thread Cameron Simpson
On 21Jul2008 23:35, Leif Walsh <[EMAIL PROTECTED]> wrote: | On Tue, 22 Jul 2008, Cameron Simpson wrote: | > Leaving aside the 0.2 => 0 converstion, shouldn't read() raise an | > exception if asked for < 1 bytes? Or is there a legitimate use for | > read(0) with which

Re: [Python-Dev] PEP 3142: Add a "while" clause to generator expressions

2009-01-19 Thread Cameron Simpson
d thus I'm -1 on the original suggestion too (also for the if/while confusion mentioned in the thread). Cheers, -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ Drive Agressively Rash Magnificently - Nankai Leathers ___

Re: [Python-Dev] PEP 3142: Add a "while" clause to generator expressions

2009-01-21 Thread Cameron Simpson
ut it neatly handled the fact that the while-test must often be preceeded by some setup that would be replicated at the loop bottom in Python and many other languages: setup-invariant-state while test-invariant do stuff setup-invariant-state of which the bare while... and converse do...wh

Re: [Python-Dev] cpython (3.2): NUL -> NULL

2011-08-19 Thread Cameron Simpson
| | "The construction '\0' is commonly used to represent the null character." | | So I think it should be either NUL or "null character" with the lower | case spelling. +1 from me, too. -- Cameron Simpson DoD#743 http://www.cskk.ezoshosting.com/cs/ I like to kee

Re: [Python-Dev] FileSystemError or FilesystemError?

2011-08-24 Thread Cameron Simpson
nly -0 for | FileSystemError (so I expect that will be the option chosen, given | other responses). I also use "filesystem" as a one word piece of jargon, but I am persuaded by the language arguments. So I'm +1 for FileSystemError. Cheers, -- Cameron Simpson DoD#743 http://www.cskk.e

Re: [Python-Dev] cpython (3.2): Issue #11956: Skip test_import.test_unwritable_directory on FreeBSD when run as

2011-10-05 Thread Cameron Simpson
#x27;s as bad as compiling stuff as root etc etc. A bad idea all around, securitywise. Especially, I would think, a builtbot. "Oh, let's fetch some shiny new code and run it as the system superuser." I know this post sounds shouty, but I've just reread it a few times and still cannot br

<    1   2   3   >