[issue10515] csv sniffer does not recognize quotes at the end of line

2010-11-23 Thread Andrew McNamara

Changes by Andrew McNamara andr...@object-craft.com.au:


--
nosy: +andrewmcnamara

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10515
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1225769] Proposal to implement comment rows in csv module

2010-02-03 Thread Andrew McNamara

Andrew McNamara andr...@object-craft.com.au added the comment:

Okay, while I am sympathetic to the points raised by the people asking for this 
enhancement, I'm persuaded to reject it by the arguments that the potential 
benefit is outweighed by the increase in complexity (code and documentation).

While the attached patch from Iain requires relatively minor and innocuous 
changes to the state machine, it only satisfies a limited subset of users, and 
the effect of complexity is geometric. In other words, to understand the state 
machine, you need to understand the relation of each state to every other 
state, etc.

As to why the core of the module is implemented in C, the sort of stateful 
parsing done by the module is one area where python does not excel (Ha!). 
Stripping comments, on the other hand, CAN be done with reasonable efficiency 
from python (and considerably more flexibility). Also, it has been my 
experience that CSV files that use comments typically have other non-standard 
features as well, requiring additional pre- and post-processing in any case.

--
resolution:  - rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1225769
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1225769] Proposal to implement comment rows in csv module

2010-02-03 Thread Andrew McNamara

Andrew McNamara andr...@object-craft.com.au added the comment:

Note that there is one case that cannot easily be addressed via pre-processing: 
where the comment character coincidently appears at the start of a line within 
a multi-line quoted field. For example:

# This is a comment
1, 2, This is field^M
#3

What this should produce is debatable, but it would be hard to make it produce:

  [1, 2, This is field^M#3]

without implementing it within the parser.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1225769
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue416670] MatchObjects not deepcopy()able

2008-11-04 Thread Andrew McNamara

Changes by Andrew McNamara [EMAIL PROTECTED]:


--
versions: +Python 2.5.3, Python 2.6

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue416670
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue416670] MatchObjects not deepcopy()able

2008-11-03 Thread Andrew McNamara

Andrew McNamara [EMAIL PROTECTED] added the comment:

One reason why this issue has been having less impact is that a bug in 
some versions of the copy.py code meant it was ignoring the 
__deepcopy__ stubs and using the pickle logic to copy _sre objects - 
so, if you run the right python version, compiled regular expressions 
and match objects deepcopy without problems.

On the 2.4 branch (release24-maint), changeset 38430 introduced the bug 
that prevents the class __deepcopy__ exception-raising stubs being 
found.

As an aside, I don't understand why the _sre objects should be 
pickleable, but not deepcopy-able.

--
nosy: +andrewmcnamara
versions: +Python 2.7 -Python 2.6

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue416670
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3756] re.escape() does not work with bytes()

2008-09-10 Thread Andrew McNamara

Andrew McNamara [EMAIL PROTECTED] added the comment:

Looks fine, except I used frozenset for the _alphanum* variables and
reverted to double quotes like the rest of the file.  Submitted as r66366.

All good. Thankyou.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3756
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3756] re.escape() does not work with bytes()

2008-09-07 Thread Andrew McNamara

Andrew McNamara [EMAIL PROTECTED] added the comment:

I don't think it's possible to say whether it's preformance critical - 
I can certainly image use cases such as parser generators where its 
speed could be noticed.

I tried building a version using regular expressions, but I couldn't do 
any better than 5x slower than the existing implementations, and the 
resulting code was less readable.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3756
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3756] re.escape() does not work with bytes()

2008-09-07 Thread Andrew McNamara

Andrew McNamara [EMAIL PROTECTED] added the comment:

I meant I can certainly imagine use cases...

In case it's not clear, I think the implementation in the patch is 
good enough (unless someone can suggest any obvious optimisations).

If someone can prove that re.escape() performance is causing problems 
for other modules in the standard lib (email, ctypes, warnings, 
fnmatch, _strptime use it, among others), then we might consider a C 
implementation.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3756
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3756] re.escape() does not work with bytes()

2008-09-04 Thread Andrew McNamara

Andrew McNamara [EMAIL PROTECTED] added the comment:

On further testing, sometimes the str version is faster, sometimes the 
bytes version is faster. Never more than about 50% one way or the 
other, so probably not worth worrying about, although I still don't 
really like the implementation. Maybe it deserves a C implementation?

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3756
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3747] Fix caching in ABCMeta.__subclasscheck__

2008-09-02 Thread Andrew McNamara

Changes by Andrew McNamara [EMAIL PROTECTED]:


--
nosy: +andrewmcnamara

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3747
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3756] re.escape() does not work with bytes()

2008-09-02 Thread Andrew McNamara

Andrew McNamara [EMAIL PROTECTED] added the comment:

Will do, although I'm slightly concerned that my bytes version of the 
function is about 50% slower than the str version. I can see why, I 
just can't think of a way to do it any faster. There's an inherent 
asymetry in bytes type that didn't exist before: b''.join(list(b'abc')) 
does not work. Of course, this does work: bytes(list(b'abc')), but the 
bytes constructor only accepts ints, not bytes. I'd like to see either 
the join method accept ints as well as bytes, or the bytes ctor accept 
bytes as well as ints. Or something.

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3756
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3756] re.escape() does not work with bytes()

2008-09-02 Thread Andrew McNamara

Changes by Andrew McNamara [EMAIL PROTECTED]:


Added file: http://bugs.python.org/file11352/re_escape-patch

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3756
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3756] re.escape() does not work with bytes()

2008-09-01 Thread Andrew McNamara

New submission from Andrew McNamara [EMAIL PROTECTED]:

In python 2, re.escape() works with either str or unicode, but in 
python 3, re.escape() no longer works correctly with the bytes type.

--
components: Regular Expressions
messages: 72309
nosy: andrewmcnamara
severity: normal
status: open
title: re.escape() does not work with bytes()
type: behavior
versions: Python 3.0

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3756
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue3756] re.escape() does not work with bytes()

2008-09-01 Thread Andrew McNamara

Andrew McNamara [EMAIL PROTECTED] added the comment:

The attached re_escape.py is a (somewhat crappy) fix for re.escape()

Added file: http://bugs.python.org/file11340/re_escape.py

___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3756
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1225769] Proposal to implement comment rows in csv module

2008-04-15 Thread Andrew McNamara

Andrew McNamara [EMAIL PROTECTED] added the comment:

I think it's a reasonable enough request - I've certainly had to 
process CSV files with comments. Iain - appologies for not looking at 
your request before now - 3 years is a pretty poor response time.

Some thoughts:
 * this should target 2.6, not 2.5 (as 2.5 is in maintenance only)?
 * the check that disallows space - I wonder what other things it 
should disallow - the delimiter?
 * should it support multicharacter comments, like the C++ //-style 
comment? I think no.
 * any implications for the py3k port?

Skip - are you happy making the changes, or should I dust off my 
working copy?

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1225769
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1744580] cvs.get_dialect() return a class object

2007-11-04 Thread Andrew McNamara

Andrew McNamara added the comment:

Seems okay to me. I had a quick look at the examples section, and it 
shows a use like the one I mention, but I wonder if the section on 
dialects should quote the specific examples I mention?

_
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1744580
_
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com