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

2022-03-19 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> rejected
stage:  -> 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



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

2022-03-19 Thread Grégory Starck

Grégory Starck  added the comment:

FWIW -1 as well, for same reasons.

--
nosy: +gstarck

___
Python tracker 

___
___
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

2022-03-19 Thread Irit Katriel


Irit Katriel  added the comment:

-1.

This is basically a request to add API to the stdlib to turn a two-liner into a 
one-liner.

--
nosy: +iritkatriel

___
Python tracker 

___
___
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 

___
___
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 Eric V. Smith


Eric V. Smith  added the comment:

I think it's a bad design to overload a function based on the type of am 
argument. I realize the stdlib does this in a number of places, for older 
functions. I don't think we'd add such a function today.

I might not object to a new pickle API to do this, but I think the best 
approach is to have your own wrapper function.

--
nosy: +eric.smith

___
Python tracker 

___
___
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


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 

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