[issue40074] pickle module dump and load: add support for string file names

2020-03-26 Thread Diego Palacios


New submission from Diego Palacios :

The pickle functions dump and load are often used in the following lines:

```python
import pickle

fname = '/path/to/file.pickle'

with open(fname, 'rb') as f:
object = pickle.load(f)
```

The load function should also accept a file name (string) as input and 
automatically open and load the object. The same should happen for the dump 
function. This would allow a simple use of the functions:

```python
object = pickle.load(fname)
```

This is what many users need when reading and storing and object from/to a file.

--
components: Library (Lib)
messages: 365061
nosy: Diego Palacios
priority: normal
severity: normal
status: open
title: pickle module dump and load: add support for string file names
type: enhancement
versions: Python 3.9

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



[issue40074] pickle module dump and load: add support for string file names

2020-03-26 Thread Diego Palacios


Diego Palacios  added the comment:

In this case two new functions should be added to the pickle function. I think 
they would be very useful and many users would make use of them.

--

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