Re: [Python-Dev] The fate of 3.0.*

2009-02-13 Thread Andrew McNamara
>So what are the expected efforts for 3.1? >- io-in-C >- import-in-Python >- ... anything else? A fixed "email" module. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Python-Dev m

Re: [Python-Dev] pyc files, constant folding and borderline portability issues

2009-04-07 Thread Andrew McNamara
On 07/04/2009, at 7:27 AM, Guido van Rossum wrote: On Mon, Apr 6, 2009 at 7:28 AM, Cesare Di Mauro wrote: The Language Reference says nothing about the effects of code optimizations. I think it's a very good thing, because we can do some work here with constant folding. Unfortunately the

Re: [Python-Dev] Issues with Py3.1's new ipaddr

2009-06-02 Thread Andrew McNamara
On 03/06/2009, at 3:56 AM, Jean-Paul Calderone wrote: On Tue, 02 Jun 2009 19:34:11 +0200, "\"Martin v. Löwis\"" > wrote: [snip] You seem comfortable with these quirks, but then you're not planning to write software with this library. Developers who do intend to write meaningful network appl

Re: [Python-Dev] Issues with Py3.1's new ipaddr

2009-06-02 Thread Andrew McNamara
On 03/06/2009, at 12:39 PM, Guido van Rossum wrote: I'm disappointed in the process -- it's as if nobody really reviewed the API until it was released with rc1, and this despite there being a significant discussion about its inclusion and alternatives months ago. (Don't look at me -- I wouldn't

Re: [Python-Dev] PEP 3144 review.

2009-09-14 Thread Andrew McNamara
ut I haven't been able to give it the attention it deserves. I also note that many methods in the reference implementation are not discussed in the PEP. While I don't consider this a problem for the PEP, anyone reviewing the module for inclusion in the standard lib needs to consider them.

Re: [Python-Dev] PEP 3144 review.

2009-09-15 Thread Andrew McNamara
it's enough to implement some basic container behaviour, but I won't object to the iterator and indexing, provided they don't distort the rest of the design (which I fear they are doing now). Iterating or indexing a network should return Address or AddressWithMask instances - if the later,

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Andrew McNamara
n AddressWithMask entity (existing Network, but no container behaviour) There is a school of thought that says we only need a single class that behaves like the current Network entity - end-points are simply represented by an all-ones mask. This is, I think, where we started. But this scheme was rejecte

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Andrew McNamara
255.255.0). But we've moved to a more compact and logical notation where the number of leading significant bits is specified (eg /24). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Python-Dev maili

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Andrew McNamara
est the AddressWithMask classes not have any network/container behaviours for a similar reason. If the developer needs these, the .network attribute is only a lookup away. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ __

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Andrew McNamara
tons should not simultaneously be containers - it's not pythonic, and it leads to ambiguity. The underlying IP concepts don't require it either: an IP address is a singleton, a network is a container, and there is no overlap. Yes, an address may be a member of a network

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Andrew McNamara
ress >referring back to the network object it was obtained >from. Yes. (Of course, we're simplifying - there would really be classes for each protocol). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Py

Re: [Python-Dev] PEP 3144 review.

2009-09-16 Thread Andrew McNamara
ometimes when you want to record an *address* you use a class called Network, and that class comes with a behaviours that make no sense in the context of a singleton network end-point (it can't "contain" other addresses, although it's .network can). Sorry if I sound like a cracke

Re: [Python-Dev] PEP 3144 review.

2009-09-17 Thread Andrew McNamara
stacks in Python, amazingly enough), but in theory ... The implementation already lazily creates most things like this. >Finally, I agree that using IPv4Network as address-with-mask is a >confusing, undiscoverable abuse. In particular, I think that every >time I went a week without using

Re: [Python-Dev] PEP 3144 review.

2009-09-17 Thread Andrew McNamara
>On Thu, 17 Sep 2009 10:41:37 am Andrew McNamara wrote: >> In the olden days, the mask was spelled out in octets (eg >> 255.255.255.0). But we've moved to a more compact and logical >> notation where the number of leading significant bits is specified >> (eg /24).

Re: [Python-Dev] PEP 3144 review.

2009-09-17 Thread Andrew McNamara
gt;> addr_a in addr_b >> >> I don't think the intent is as clear with the later. > >I would find the later completely unclear and disturbing -- how can one >address contain another address? Yes - that's how it works now, and I can only see it resulting in confu

Re: [Python-Dev] PEP 3144 review.

2009-09-17 Thread Andrew McNamara
address and mask, but I understand your confusion - we're mixing terminology from disperate domains. In my postings, I have tried to refer to Network (a containter) and Address (an item). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Andrew McNamara
>off to patch the pep and implement some of the non controversial changes. It might be a good idea to add some use-cases to the PEP. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Python-Dev mailing list Pyt

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Andrew McNamara
itioning the functionality differently will result in a better outcome all round. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/

Re: [Python-Dev] conceptual clarity

2009-09-17 Thread Andrew McNamara
w a specific implementation can be used. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.pyt

Re: [Python-Dev] PEP 3144 review.

2009-09-17 Thread Andrew McNamara
>On Fri, 18 Sep 2009 11:04:46 am Andrew McNamara wrote: >> >To a non-specialist, "the network address" is ambiguous. There are >> > many addresses in a network, and none of them are the entire >> > network. It's like saying, given a list [2, 4, 8, 12],

Re: [Python-Dev] PEP 3144 review, and the inclusion process

2009-09-28 Thread Andrew McNamara
cation of network addresses, this would be spelt: IPv?AddressWithMask(some_address).network At first glance, this seems somewhat round-about, however it makes explicit the potential loss of bits. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ __

Re: [Python-Dev] Supporting raw bytes data in urllib.parse.* (was Re: Polymorphic best practices)

2010-09-21 Thread Andrew McNamara
the app was in the hands of users, and it didn't seem to matter how careful I was. Py3 has gone the pure/strict route in the core, and I think libs should be consistent with that choice. Developers will have work a little harder, but there will be les

Re: [Python-Dev] Python-3000 upgrade path

2007-03-11 Thread Andrew McNamara
The pretty/efficient version is tantamount to guessing, and effectively discards information in the transformation ("here be dragons"). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Python-De

Re: [Python-Dev] These csv test cases seem incorrect to me...

2007-03-11 Thread Andrew McNamara
point was to produce the same results as Excel. Sure, Excel probably doesn't generate crap like this itself, but 3rd parties do, and people complain if we don't parse it just like Excel (sigh). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ __

Re: [Python-Dev] [Csv] These csv test cases seem incorrect to me...

2007-03-11 Thread Andrew McNamara
he parser to optionally accept some other format, I have no problem. If you want to make this format the default, make sure you stick around to answer all the angry e-mail from users. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ __

Re: [Python-Dev] [Fwd: PEP 0305 (small problem with the CSV reader)]

2007-03-27 Thread Andrew McNamara
to 128K, but you can set it to anything up to (2**31)-1 or 2147483647 (about 2 billion). BTW, I've taken the liberty of CC'ing this to the python-dev list, so the motivation for this feature is recorded - it caused me some head scratching, and I adde

Re: [Python-Dev] Summary of Tracker Issues

2007-05-14 Thread Andrew McNamara
ly parallel, so they really don't care that some of their posts are never seen. I'm reluctant to mention the name of one particular tool I'm aware of, but as well as the above, it also has OCR to defeat CAPTCHA, and automatically creates throw-away e-mail accounts with a range of free

Re: [Python-Dev] Summary of Tracker Issues

2007-05-16 Thread Andrew McNamara
generated spams. The mind boggles at the economics or desperation that make this worthwhile. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/ma

Re: [Python-Dev] Summary of Tracker Issues

2007-05-16 Thread Andrew McNamara
can post comments >or whatever they need to do. Yep - I was aware of this trick, but the ones I'm talking about have also got through filling out questionnaires, and whatnot. Certainly the same technique could be used, but my suspicion is that real people are being paid a pittance to

[Python-Dev] Calling back into python from C

2007-07-24 Thread Andrew McNamara
upport Python versions back to 2.3. Am I correct in using PyGILState_Ensure() and PyGILState_Release()? If so, how do I support back to Py 2.3? Copy the current fixed PyGILState_Release() into my code (ick)? -- Andrew McNamara, Senior Developer, Object Craft

Re: [Python-Dev] Python developers are in demand

2007-10-15 Thread Andrew McNamara
>I wonder if we should start maintaining a list of Python developers >for hire somewhere on python.org, beyond the existing Jobs page. Is >anyone interested in organizing this? What about something a little less formal - a mailing list such as python-jobs? -- Andrew McNamara, Senior

Re: [Python-Dev] XML codec?

2007-11-12 Thread Andrew McNamara
codec from me as well. >Martin's right: there's no value to embedding the logic of auto- >detection into the codec. A function somewhere in the xml package is >all that's warranted. I agree with Fred here - it should be a function in the xml package, not a codec. -1 --

Re: [Python-Dev] pkgutil, pkg_resource and Python 3.0 name space packages

2008-01-07 Thread Andrew McNamara
nction of interest. I mostly remember, but there are some notable exceptions: exists (posix system call, expect to find it in os), walk (which is the old deprecated one? have to check doc). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___

Re: [Python-Dev] Monkeypatching idioms -- elegant or ugly?

2008-01-20 Thread Andrew McNamara
>I think that despite the objection that monkeypatching shoudn't be >made too easy, it's worth at looking into a unification of the API, >features, and implementation. I agree. The other virtue of having it in the standard library is that it's immediately recognisable for

Re: [Python-Dev] [Python-3000] Removing bsddb module from py3k (was Re: No beta2 tonight)

2008-07-20 Thread Andrew McNamara
teractions with other systems - for example, using it to maintain Radius user databases for a (proprietary/commercial) Radius auth daemon. But dropping it from the core won't stop this. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/

Re: [Python-Dev] [Csv] skipfinalspace

2008-10-19 Thread Andrew McNamara
e to at least have a dialect that is >excel + skipinitialspace=True + skipfinalspace=True. Once the "skipfinalspace" parameter is implemented, there is nothing stopping you creating such a dialect in your code, but I don't support adding it to the standard library - the dialect

[Python-Dev] Python2.5 _sre deepcopy regression?

2008-10-22 Thread Andrew McNamara
details: http://bugs.python.org/issue416670 Changeset 38430 on the release24-maint branch introduced the changes that stopped SRE_Pattern.__deepcopy__ being found. r38430 was a patch forward ported from 2.3, but never ported to the trunk (probably a good thing, too). Thou

Re: [Python-Dev] Python2.5 _sre deepcopy regression?

2008-11-03 Thread Andrew McNamara
() >in 2.4, and copy.deepcopy() falls back to using the pickle logic. > >The _sre source has #ifdef-out support for __deepcopy__, issue 416670 >has the gory details: > >http://bugs.python.org/issue416670 > >Changeset 38430 on the release24-maint branch introduced the changes &g

[Python-Dev] Py2.4 _sre uses uninitialised memory (Bug 1088891)

2004-12-21 Thread Andrew McNamara
more obvious (dies on a reference to 0x5558) for me. See bug ID 1088891: http://sourceforge.net/tracker/index.php?func=detail&aid=1088891&group_id=5470&atid=105470 Can I be the only person who crafts diabolical regexps? Here, have a lend of my brown paper bag... -- Andrew

[Python-Dev] csv module TODO list

2005-01-04 Thread Andrew McNamara
collection of little helper functions like get_string, set_string, etc. This code appears to be excessively general; since they're called only once, it seems clearer to inline the logic directly in the get/set methods for the lineterminat

Re: [Python-Dev] Re: [Csv] csv module TODO list

2005-01-04 Thread Andrew McNamara
m >CSV files. The comment I get repeatedly is that they don't use it because it's "too magic/scary". That's as it should be. But if it didn't exist, then someone would be requesting we add it... 8-) -- Andrew McNamara, Senior Developer, Object Craft http://

Re: [Python-Dev] csv module TODO list

2005-01-05 Thread Andrew McNamara
>> Andrew McNamara wrote: >>> There's a bunch of jobs we (CSV module maintainers) have been putting >>> off - attached is a list (in no particular order): >>> * unicode support (this will probably uglify the code considerably). >> >Martin v. Löwis w

Re: [Python-Dev] csv module TODO list

2005-01-05 Thread Andrew McNamara
your needs: CSV files tend to be small enough >to do the decoding in one call in memory. We are routinely dealing with multi-gigabyte csv files - which is why the original 2001 vintage csv module was written as a C state machine. -- Andrew McNamara, Senior Developer, Object Craft http://www.o

Re: [Python-Dev] csv module TODO list

2005-01-05 Thread Andrew McNamara
fore passing it through the unicode state machine, which would yield tuples of unicode objects. That leaves us with a bit of a problem where the source is already unicode (eg, a list of unicode strings)... hmm. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.a

[Python-Dev] Re: [Csv] csv module TODO list

2005-01-05 Thread Andrew McNamara
have a docstring? csv_writerow does Was fixed. >* any PyUnicode_* methods should be protected with #ifdef Py_USING_UNICODE Was fixed. >* csv_unregister_dialect, csv_get_dialect could use METH_O >so you don't need to use PyArg_ParseTuple Was fixed. >* in init_csv, recommend using &

[Python-Dev] Re: csv module TODO list

2005-01-05 Thread Andrew McNamara
ated issue was included in my TODO list: >* Address or document Francis Avila's issues as mentioned in this posting: > >http://www.google.com.au/groups?selm=vsb89q1d3n5qb1%40corp.supernews.com -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ _

Re: [Python-Dev] csv module TODO list

2005-01-05 Thread Andrew McNamara
d a utf-16 encoded character span a line break, for example). The writer interface probably should have similar facilities. However - a number of people have complained about the "iterator" interface, wanting to supply strings (the iterable is necessary because a CSV row can span multi

Re: [Csv] Re: [Python-Dev] csv module TODO list

2005-01-05 Thread Andrew McNamara
parser would need to raise an exception. The DictReader and DictWriter classes will probably need matching UnicodeDictReader/UnicodeDictWriter versions (use common base class, just specify alternate parser). -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ __

[Python-Dev] Re: [Csv] csv module TODO list

2005-01-06 Thread Andrew McNamara
, or is my understanding of the reference manual incorrect? -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: h

[Python-Dev] Minor change to behaviour of csv module

2005-01-06 Thread Andrew McNamara
semi-random, including TypeError, AttributeError and csv.Error - they should now almost always be TypeError (like most other argument passing errors). I can't see this being a problem, but I'm prepared to listen to arguments. -- Andrew McNamara, Senior Developer, Object Craft http://www.ob

Re: [Python-Dev] Minor change to behaviour of csv module

2005-01-07 Thread Andrew McNamara
t is, as the default: it's conceivable that someone somewhere is post-processing the result to remove the backslashes, and if we fix the csv module, we'll break their code. Note that PEP-305 had nothing to say about escaping, nor does the module reference manual. -- Andrew McNamara, Senior

Re: [Python-Dev] Re: csv module TODO list

2005-01-09 Thread Andrew McNamara
the parser gets to the end of the string and finds it's still within a field, I'd propose just raising an exception. No promises, however - I only have a finite ammount of time to work on this at the moment. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.c

Re: [Python-Dev] Re: [Csv] Minor change to behaviour of csv module

2005-01-09 Thread Andrew McNamara
he escape character - in other words, only special (quoting, escaping, field delimiter) characters received special treatment. With the benefit of hindsight, that was an inadequately considered choice. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/

[Python-Dev] csv module and universal newlines

2005-01-09 Thread Andrew McNamara
be to provide a new interface that relies on a file-like object being supplied. The lineterminator character would only be used with this interface, with the current interface falling back to using only \n. Rather a drastic solution. Any other ideas? -- Andrew McNamara, Senior De

Re: [Python-Dev] Re: [Csv] csv module TODO list

2005-01-11 Thread Andrew McNamara
like to see a DBF parser in python - reading and writing odd file formats is bread-and-butter for us contractors... 8-) -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___ Python-Dev mailing list Python-Dev@py

Re: [Python-Dev] Re: [Csv] csv module and universal newlines

2005-01-12 Thread Andrew McNamara
't like the idea of looking for a mode attribute on the supplied iterator - it feels like a layering violation. We've advertised the fact that it's an iterator, so we shouldn't be using anything but the iterator protocol. -- Andrew McNamara, Senior Developer, Object Craft

Re: [Python-Dev] Re: [Csv] csv module and universal newlines

2005-01-12 Thread Andrew McNamara
oviding an iterator. Neither have I, funnily enough. >Unicode, on the other hand, I have had problems with. Ah, so somebody does want it then? Good to hear. Hard to get motivated to make radical changes without feedback. -- Andrew McNamara, Senior Developer, Object Craft http://w

Re: [Python-Dev] UserString

2005-02-22 Thread Andrew McNamara
ther hand, LBYL in this context can result in race conditions and security vulnerabilities. "os.makedirs" is already a composite of many system calls, so all bets are off anyway, but for simpler operations that result in an atomic system call, this is important. -- Andrew McNamara, Sen

Re: [Python-Dev] UserString

2005-02-24 Thread Andrew McNamara
ix, cough). All well-coded unix apps are dependent on system calls returning consistent errno's. Which is one thing that makes life so difficult for "posix" environments layered on other operating systems. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.

[Python-Dev] Faster Set.discard() method?

2005-03-17 Thread Andrew McNamara
implemented as the much clearer: try: self.remove(element) except KeyError: pass But the dict.pop method is about 12 times faster. Is this worth doing? -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ _

Re: [Python-Dev] Faster Set.discard() method?

2005-03-17 Thread Andrew McNamara
le than it already is would be a step backwards. On the other hand, Jython and PyPy are already in trouble - the builtin set() is not entirely compatible with sets.Set. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ ___

Re: [Python-Dev] Faster Set.discard() method?

2005-03-17 Thread Andrew McNamara
C level - all they do is set a flag. The expense of exceptions is saving a restoring python frames, I think, which doesn't happen in this case. So the current implementation is ideal for C code - clear and fast. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/ __

[Python-Dev] Re: [Csv] Example workaround classes for using Unicode with csv module...

2005-03-20 Thread Andrew McNamara
characters for the characters with special meaning to the parser: note also that none of the special characters (quotechar, delimiter, escapechar, etc) can be a multi-byte sequence. -- Andrew McNamara, Senior Developer, Object Craft http://www.object-craft.com.au/

Re: [Python-Dev] Socket module corner cases

2006-05-30 Thread Andrew McNamara
t handled)" >... getprotobyname() looks up the /etc/protocols file (on a unix system - I don't know about windows), whereas the socket.IPPROTO_* constants are populated from the #defines in netinet/in.h at compile time. Personally, I think /etc/pro

Re: [Python-Dev] Socket module corner cases

2006-05-30 Thread Andrew McNamara
ccurs independent of >whether the flag is specified. Does it actually do anything? > >Does getnameinfo() support IPv6? It appears to fail (with a socket.error >that says "sockaddr resolved to multiple addresses") if both IPv4 and IPv6 >are enabled. Someone more knowledgeable

Re: [Python-Dev] "and" and "or" operators in Py3.0

2005-09-19 Thread Andrew McNamara
abel) and a manditory system name. So this sort of thing becomes common: '%s blah blah' % (foo.label or foo.name) The if-else-expression alternative works, but isn't quite as readable: '%s blah blah' % (foo.label ? foo.label : foo.