[Python-bugs-list] [ python-Feature Requests-416670 ] MatchObjects not deepcopy()able

noreply@sourceforge.net noreply@sourceforge.net
Mon, 10 Dec 2001 10:50:32 -0800


Feature Requests item #416670, was opened at 2001-04-17 05:31
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=355470&aid=416670&group_id=5470

>Category: Regular Expressions
Group: None
Status: Open
>Priority: 3
Submitted By: Henning Thielemann (amigalemming)
>Assigned to: Fredrik Lundh (effbot)
Summary: MatchObjects not deepcopy()able

Initial Comment:

In the re-Module which come with Python version 2.0
(Nov 28 11:10 re.py) the created MatchObjects cannot be
copied with a deepcopy(). Switching back to the old
"pre.py" as proposed in "re.py" makes everything work
ok.



----------------------------------------------------------------------

Comment By: Fredrik Lundh (effbot)
Date: 2001-04-28 01:53

Message:
Logged In: YES 
user_id=38376

On the other hand, it looks like we've found a rather
elegant way to solve this.  I'll leave this one open
(as a feature request).

----------------------------------------------------------------------

Comment By: Henning Thielemann (amigalemming)
Date: 2001-04-27 03:03

Message:
Logged In: YES 
user_id=197994

You are right, m.groupdict() and m.groups() are surely the
better choice.


----------------------------------------------------------------------

Comment By: Fredrik Lundh (effbot)
Date: 2001-04-26 14:50

Message:
Logged In: YES 
user_id=38376

I'm not sure this is a bug -- imo, you're relying on
an implementation artifact in the original PCRE port.
And making this work under SRE isn't as easy as it may
appear (the proposed patch may work in your specific
case, but it isn't a general solution).

But before I make up my mind here, maybe you could tell
me why you think it's a good idea to use deepcopy on
match objects.  Why not just store "m.groups()" or
"m.regs" instead?

Cheers /F

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2001-04-26 01:01

Message:
Logged In: YES 
user_id=21627

A patch for that problem is in
http://sourceforge.net/tracker/index.php?func=detail&aid=419070&group_id=5470&atid=305470

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=355470&aid=416670&group_id=5470