[issue32299] unittest.mock.patch.dict.__enter__ should return the dict

2017-12-12 Thread Allen Li

Change by Allen Li <vianchielfa...@gmail.com>:


--
type:  -> enhancement

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32299>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32299] unittest.mock.patch.dict.__enter__ should return the dict

2017-12-12 Thread Allen Li

New submission from Allen Li <vianchielfa...@gmail.com>:

mock.patch.dict.__enter__ should return the patched dict/mapping object.

Currently it returns nothing (None).

This would make setting up fixtures more convenient:

 with mock.patch.dict(some.thing):
   some.thing['foo'] = 'bar'

 with mock.patch.dict(some.thing) as x:
   x['foo'] = 'bar'

--
components: Library (Lib)
messages: 308188
nosy: Allen Li
priority: normal
severity: normal
status: open
title: unittest.mock.patch.dict.__enter__ should return the dict
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32299>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9924] sqlite3 SELECT does not BEGIN a transaction, but should according to spec

2017-12-02 Thread Allen Li

Change by Allen Li <vianchielfa...@gmail.com>:


--
nosy: +Allen Li

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue9924>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31843] sqlite3.connect() should accept PathLike objects

2017-10-22 Thread Allen Li

New submission from Allen Li <vianchielfa...@gmail.com>:

sqlite3.connect() should accept PathLike objects (objects that implement 
__fspath__)

--
messages: 304773
nosy: Allen Li
priority: normal
severity: normal
status: open
title: sqlite3.connect() should accept PathLike objects
versions: Python 3.6

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31843>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31843] sqlite3.connect() should accept PathLike objects

2017-10-22 Thread Allen Li

Change by Allen Li <vianchielfa...@gmail.com>:


--
type:  -> enhancement

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31843>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue31822] Document that urllib.parse.{Defrag, Split, Parse}Result are namedtuples

2017-10-19 Thread Allen Li

New submission from Allen Li <vianchielfa...@gmail.com>:

It would be useful to document that urllib.parse.{Defrag,Split,Parse}Result are 
namedtuples, and make that API officially public if it was not otherwise.

These classes are implemented as namedtuples in Python 2 and 3, and I am not 
aware of a reason that that would need to change in the future.

In particular, the namedtuple _replace() method is very useful for modifying 
parts of a URL, a common use case.

 u = urllib.parse.urlsplit(some_url)
 u = u._replace(netloc=other_netloc)
 urllib.parse.urlunsplit(u)

 # Alternatives not depending on namedtuple API
 parts = list(u)
 parts[1] = other_netloc  # Using a magic index
 urllib.parse.urlunsplit(u)

 u = urllib.parse.SplitResult(  # Very ugly
 scheme=u.scheme,
 netloc=other_netloc,
 path=u.path,
 query=u.query,
 fragment=u.fragment)

--
assignee: docs@python
components: Documentation
messages: 304637
nosy: Allen Li, docs@python
priority: normal
severity: normal
status: open
title: Document that urllib.parse.{Defrag,Split,Parse}Result are namedtuples
type: enhancement
versions: Python 2.7, Python 3.6

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue31822>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com