[issue10076] Regex objects became uncopyable in 2.5

2017-04-16 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10076] Regex objects became uncopyable in 2.5

2017-04-16 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset fdbd01151dbd5feea3e4c0316d102db3d2a2a412 by Serhiy Storchaka in 
branch 'master':
bpo-10076: Compiled regular expression and match objects now are copyable. 
(#1000)
https://github.com/python/cpython/commit/fdbd01151dbd5feea3e4c0316d102db3d2a2a412


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10076] Regex objects became uncopyable in 2.5

2017-04-05 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
pull_requests: +1173

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10076] Regex objects became uncopyable in 2.5

2017-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Since the pattern and the match objects can be considered as immutable, it is 
worth to implement __copy__ and __deepcopy__ returning the object itself. 
Proposed PR does this. It also fixes signatures of __deepcopy__ methods.

Since copying didn't work in all maintained version for long time, this is 
rather a new feature than a bug fix.

--
nosy: +serhiy.storchaka
type: behavior -> enhancement
versions: +Python 3.7 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10076] Regex objects became uncopyable in 2.5

2014-10-23 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Regular Expressions
versions: +Python 3.4, Python 3.5 -Python 3.1

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10076] Regex objects became uncopyable in 2.5

2012-08-27 Thread Michael Shields

Michael Shields added the comment:

It's not strictly necessary that re objects be copyable, but there's no reason 
to break it either.  It's not strictly necessary that str or int be copyable 
either.

This came up in code that had objects with a number of members, one of which 
was a regexp pattern object.  deepcopy of this object broke in 2.5.

--
nosy: +shields

___
Python tracker 

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



[issue10076] Regex objects became uncopyable in 2.5

2012-08-26 Thread Matthew Barnett

Matthew Barnett added the comment:

Is it necessary to actually copy it? Isn't the pattern object immutable?

--
nosy: +mrabarnett

___
Python tracker 

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



[issue10076] Regex objects became uncopyable in 2.5

2012-08-24 Thread Анхбаяр Лхагвадорж

Анхбаяр Лхагвадорж added the comment:

Ding.

--
nosy: +Анхбаяр.Лхагвадорж

___
Python tracker 

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



[issue10076] Regex objects became uncopyable in 2.5

2010-10-21 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue10076] Regex objects became uncopyable in 2.5

2010-10-14 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

The patch looks reasonable to me.

I was trying to find out why they got disabled after 2.5, but I don't see any 
reason. (There was an issue open and it was closed for no reason). So, I think, 
this should move forward, unless there is any technical objection to the patch.

--
nosy: +orsenthil, pitrou
stage:  -> patch review
superseder:  -> MatchObjects not deepcopy()able
versions: +Python 3.1 -Python 2.5, Python 2.6

___
Python tracker 

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



[issue10076] Regex objects became uncopyable in 2.5

2010-10-12 Thread Michael Shields

Michael Shields  added the comment:

Here's the patch.  I updated the test case and release notes also.

I'm a Google employee, so this patch is covered by whatever usual copyright 
arrangement we have with the PSF.

--
keywords: +patch
Added file: http://bugs.python.org/file19205/copy-pattern.diff

___
Python tracker 

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



[issue10076] Regex objects became uncopyable in 2.5

2010-10-12 Thread Michael Shields

New submission from Michael Shields :

For many years now, the sre module has provided __copy__ and __deepcopy__ 
modules that raise an exception ("cannot copy this pattern object") by default, 
with an #ifdef to enable their implementations.  Until Python 2.5, these were 
simply unused.  Since then, deepcopying these objects fails, instead of falling 
back to the default implementation.

Python 2.4.6 (#1, Nov 23 2009, 03:28:22)
[GCC 4.2.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> x = [re.compile('.*')]
>>> import copy
>>> copy.deepcopy(x)
[<_sre.SRE_Pattern object at 0x7f3e9411e168>]

Python 2.6.2 (r262:71600, Jul 24 2009, 17:29:21)
[GCC 4.2.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> x = [re.compile('.*')]
>>> import copy
>>> copy.deepcopy(x)
Traceback (most recent call last):
 File "", line 1, in 
 File "/usr/grte/v1/k8-linux/lib/python2.6/copy.py", line 162, in deepcopy
   y = copier(x, memo)
 File "/usr/grte/v1/k8-linux/lib/python2.6/copy.py", line 228, in _deepcopy_list
   y.append(deepcopy(a, memo))
 File "/usr/grte/v1/k8-linux/lib/python2.6/copy.py", line 173, in deepcopy
   y = copier(memo)
TypeError: cannot deepcopy this pattern object

I'll attach a patch against 2.7 to correct this.

--
components: Library (Lib)
messages: 118469
nosy: Michael.Shields
priority: normal
severity: normal
status: open
title: Regex objects became uncopyable in 2.5
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7

___
Python tracker 

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