Hello,
In the current incarnation Pathlib is missing some key features I need in
my usecases. I want to contribute them but i'd like a bit of feedback on
the new api before jumping to implementation.
The four things I need are:
#1. A context manager for temporary files and dirs (that cleans ever
On Saturday, November 8, 2014, Xavier Morel wrote:
>
>
> Why would pathlib need to provide this when tempfile already does?
>
> with tempfile.NamedTemporaryFile(prefix='') as f:
> tmp = pathlib.Path(f.name)
>
> with tempfile.TemporaryDirectoryDirectory(prefix='') as d:
> tmp = pat
Hey,
It appears there's a peculiar difference between the pathlib in the 3.4
branch and the one on bitbucket: cpython's pathlib.Path implements a no-op
context manager interface. What's the purpose of that? It's also
inconsistent, stat and all the methods that depend on stat do not implement
the "
> On 2014-11-08, at 20:02 , Ionel Cristian Mărieș
> wrote:
> > On Saturday, November 8, 2014, Xavier Morel
> wrote:
> >
> > Why would pathlib need to provide this when tempfile already does?
> >
> > with tempfile.NamedTemporaryFile(prefix='&
Speaking of that, shouldn't pathlib have support for dir_fd?
Thanks,
-- Ionel M.
On Mon, Nov 10, 2014 at 6:53 PM, Antoine Pitrou wrote:
> On Mon, 10 Nov 2014 13:45:57 +0200
> Ionel Cristian Mărieș wrote:
> > Hey,
> >
> > It appears there's a peculiar differe
What if we'd have metaclass semantics on module creation?
Eg, suppose the default:
__metaclass__ = ModuleType
What if Python would support __prepare__ for modules?
Thanks,
-- Ionel M.
On Sat, Nov 29, 2014 at 11:36 PM, Greg Ewing
wrote:
> Guido van Rossum wrote:
>
>> Are these really all o
You could do the sys.modules patch as Antoine suggested in a .pth file, so
that it's triggered at startup.
Eg, very similar:
https://github.com/xando/subprocess.run/blob/ab02d165802b2ad57dd0d16c1169ab05ed312ef1/subprocess.run.pth
Thanks,
-- Ionel Cristian Mărieș, blog.ionelmc.ro
On Wed, J
__(self, value):
... return int.__new__(FancyInt, value)
...
... def __repr__(self):
... return "FancyInt(%s)" % super().__repr__()
...
>>> x = FancyInt(1)
>>>
>>> x
FancyInt(1)
>>> x += 1
>>> x # it should be FancyInt(2)
2
Thanks,
-- Io
THONWEAKURANDOM=y or PYTHONFASTURANDOM=y.
That ways there's no need to change api of os.urandom() and users have a
clear and easy path to get old behavior.
Thanks,
-- Ionel Cristian Mărieș, http://blog.ionelmc.ro
___
Python-Dev mailing list
Py