>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
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
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
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
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.
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,
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
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
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/
__
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
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
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
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
>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).
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
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/
>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
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/
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
>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],
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/
__
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
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
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/
__
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/
__
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
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
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
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
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
>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
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
--
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/
___
>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
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/
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
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
()
>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
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
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
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://
>> 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
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
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
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
&
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/
_
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
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/
__
, 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
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
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
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
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/
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
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
'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
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
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
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.
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/
_
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/
___
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/
__
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/
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
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
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.
66 matches
Mail list logo