Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-28 Thread Steven D'Aprano
On Tue, May 29, 2018 at 10:11:22AM +1000, Chris Angelico wrote: > On Tue, May 29, 2018 at 9:47 AM, Steven D'Aprano wrote: > > Certainly not. You only have to be root to change permissions on files > > that you otherwise wouldn't be able to change permissions on. chmod -R > > works fine for

Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-28 Thread Chris Angelico
On Tue, May 29, 2018 at 9:47 AM, Steven D'Aprano wrote: > On Mon, May 28, 2018 at 10:13:47PM +0100, Barry wrote: >> >> > On 28 May 2018, at 21:23, Giampaolo Rodola' wrote: > [...] >> > It appears like a common enough use case to me ("chown -R path"). >> > Thoughts? >> >> I wonder if it is very

Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-28 Thread Steven D'Aprano
On Mon, May 28, 2018 at 10:13:47PM +0100, Barry wrote: > > > On 28 May 2018, at 21:23, Giampaolo Rodola' wrote: [...] > > It appears like a common enough use case to me ("chown -R path"). > > Thoughts? > > I wonder if it is very common. > Don’t you have to be root or use sudo chown? > In which

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-28 Thread Greg Ewing
Michael Lohmann wrote: I just wanted to override the class-variable `magic_number` to give a reason why I don’t ever want to call Magic.__init__ in Foo. If you want, you can have this class instead: class Magic: > def __init__(self): raise RuntimeError("Do not initialize this

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-28 Thread Greg Ewing
Michael Lohmann wrote: class Ethel(Aardvark, Clever): """Ethel is a very clever Aardvark""" def __init__(self): super().__init__(quantity="some spam", cleverness=1000)) >> if you want to instantiate an Aardvark directly there is NO WAY EVER that you could give him

[Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-28 Thread Wes Turner
path.py Path.choen supports names in addition to the uid/gid numbers which os.chown supports: https://pathpy.readthedocs.io/en/stable/api.html#path.Path.chown https://github.com/jaraco/path.py/blob/master/path.py#L1176 https://pathpy.readthedocs.io/en/stable/api.html#path.Path.walk On Monday,

Re: [Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-28 Thread Barry
> On 28 May 2018, at 21:23, Giampaolo Rodola' wrote: > > ...as in (not tested): > > def _rchown(dir, user, group): > for root, dirs, files in os.walk(dir, topdown=False): > for name in files: > chown(os.path.join(root, name), user, group) > > def

[Python-ideas] Add shutil.chown(..., recursive=False)

2018-05-28 Thread Giampaolo Rodola'
...as in (not tested): def _rchown(dir, user, group): for root, dirs, files in os.walk(dir, topdown=False): for name in files: chown(os.path.join(root, name), user, group) def chown(path, user=None, group=None, recursive=False): if recursive

Re: [Python-ideas] multiprocessing, freeze support by default for Pool

2018-05-28 Thread Brett Cannon
I would just open an issues on bugs.python.org for this. On Wed, 23 May 2018 at 17:54 Bradley Phillips < bradleyp81+python-id...@gmail.com> wrote: > Hi All > > There are about 347 results for the following query on the google search > engine: > "python multiprocessing pyinstaller crash

Re: [Python-ideas] Proposal: A Reduce-Map Comprehension and a "last" builtin

2018-05-28 Thread Nick Coghlan
On 28 May 2018 at 10:17, Greg Ewing wrote: > Nick Coghlan wrote: > >> Aye, while I still don't want comprehensions to implicitly create new >> locals in their parent scope, I've come around on the utility of letting >> inline assignment targets be implicitly nonlocal

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-28 Thread Jacco van Dorp
Bright idea the moment after sending that mail: You could remove the globals() hack if you make it a class decorator instead. ___ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct:

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-28 Thread Jacco van Dorp
2018-05-28 11:07 GMT+02:00 Michael Lohmann : > But maybe it is just me who thinks that you should make it as obvious as > possible what a class itself really can get as an input and what is done just > to get the multiple inheritance to work... So I think if no one else

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-28 Thread Jacco van Dorp
2018-05-28 9:44 GMT+02:00 Michael Lohmann : > >> I'd say NOT wanting to call an __init__ method of a superclass is a >> rather uncommon occurence. It's generally a huge error. So I think >> it's worth not accomodating that. > > I will give you an example then where I am

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-28 Thread Michael Lohmann
> I'd say NOT wanting to call an __init__ method of a superclass is a > rather uncommon occurence. It's generally a huge error. So I think > it's worth not accomodating that. I will give you an example then where I am absolutely fine with calling super().__init__ in all classes and describe why

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-28 Thread Jacco van Dorp
I'd say NOT wanting to call an __init__ method of a superclass is a rather uncommon occurence. It's generally a huge error. So I think it's worth not accomodating that. 2018-05-28 9:27 GMT+02:00 Michael Lohmann : > >>>class Magic: >>>magic_number = 42 >>>

Re: [Python-ideas] Keyword for direct pass through of kwargs to super

2018-05-28 Thread Michael Lohmann
>>class Magic: >>magic_number = 42 >>def __init__(self): >>A.magic_number = 0 # As soon as you look too deep into it all >> the Magic vanishes > > What is A here? Did you mean something else? Sorry for that. Yes, it should have been Magic (I renamed the class

Re: [Python-ideas] ternary without else

2018-05-28 Thread Jacco van Dorp
2018-05-26 11:24 GMT+02:00 Antoine Rozo : > Dismiss my message, I have read `if "art_wt" not in article`. But in the > same way, you could have a function to reset a value in your dict if the > current value evaluates to False. That won't work, since at other places, I do

Re: [Python-ideas] "Assignment expression" with function call-alike syntax

2018-05-28 Thread Jacco van Dorp
2018-05-26 11:00 GMT+02:00 Kirill Balunov : > The main point is to collect more information, since the idea of assignment > expression will have a huge impact in all aspects of Python programming: how > you structure your programm, how you write code, how you read code,