[Python-ideas] Re: Auto assignment of attributes

2022-04-23 Thread Christopher Barker
On Sat, Apr 23, 2022 at 10:53 AM Pablo Alcain wrote: > Overall, I think that not all Classes can be thought of as Dataclasses > and, even though dataclasses solutions have their merits, they probably > cannot be extended to most of the other classes. > Absolutely. However, this is not an "all Cl

[Python-ideas] Re: Auto assignment of attributes

2022-04-23 Thread Pablo Alcain
On Thu, Apr 21, 2022 at 7:33 PM Josh Rosenberg < shadowranger+pythonid...@gmail.com> wrote: > > On Wed, Apr 20, 2022 at 3:31 PM Pablo Alcain > wrote: > >> >> About dataclasses, the point that Chris mentions, I think that they are >> in a different scope from this, since they do much more stuff. B

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-23 Thread malmiteria
Stephen J. Turnbull writes: > PermissionsMixin is documented to be *abstract* -- there are *no* > default permissions in it. It either does nothing or errors when you > try to use the methods it declares.[1] > > The permission-checking is (and must be) your code. For one thing, > that's what "ab

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-23 Thread Steven D'Aprano
On Sat, Apr 23, 2022 at 10:18:05PM +0900, Stephen J. Turnbull wrote: > malmiteria writes: > > If O1 and O2 are refactored into N1(GP) and N2(GP) > > the MRO as it was before refactoring was essentially N1, GP, N2, GP, > > as what was O1 before refactoring is equivalent to N1, GP after > > ref

[Python-ideas] Re: mro and super don't feel so pythonic

2022-04-23 Thread Stephen J. Turnbull
malmiteria writes: > to give you exemples of problems : > 1) let's start with a django problem : > ``` > class MyView(ModelView, PermissionMixin): pass > ``` > > Since it's mostly made out of django stuff, it's likely there > wouldn't be automated testing to check if the permissions are