On 03/03/2018 10:46 AM, Jamesie Pic wrote:
While i understand it would be harder to make it memory efficient, but this is
python not go, and also this sort feature
could be easily optional, also, it might even help against circular import
issues, whoever hasn't imported a module from
inside a
On 4 March 2018 at 03:42, Chris Angelico wrote:
> On Sun, Mar 4, 2018 at 4:12 AM, Jamesie Pic wrote:
> >
> > Hello everybody,
> >
> > I thought perhaps we could allow the usage of a "new" keyword to
> instanciate
> > an object, ie:
> >
> >obj = new yourmodule.YourClass()
> >
> > In this case
Jamesie Pic writes:
> obj = new yourmodule.YourClass()
I don't understand what this is good for. Keeping up with PHP is not
something that is a goal for Python. Borrowing useful features is
definitely an idea, but you need to explain why it's useful.
I also don't understand why you call this
On 03Mar2018 19:46, Jamesie Pic wrote:
While i understand it would be harder to make it memory efficient, but this
is python not go, and also this sort feature could be easily optional,
also, it might even help against circular import issues, whoever hasn't
imported a module from inside a functi
On Sat, Mar 03, 2018 at 06:12:06PM +0100, Jamesie Pic wrote:
> Hello everybody,
>
> I thought perhaps we could allow the usage of a "new" keyword to
> instanciate an object, ie:
>
>obj = new yourmodule.YourClass()
>
> In this case, it would behave the same as from yourmodule import YourClass;
On Sat, Mar 3, 2018 at 9:12 AM, Jamesie Pic wrote:
>
> Hello everybody,
>
> I thought perhaps we could allow the usage of a "new" keyword to instanciate
> an object, ie:
>
>obj = new yourmodule.YourClass()
>
> In this case, it would behave the same as from yourmodule import YourClass;
> obj =
On Sat, Mar 03, 2018 at 02:33:36PM -0500, Terry Reedy wrote:
> def autoload(mod, cls, *args, **kwargs):
> from mod import cls
> return cls(*args, **kwargs)
>
> obj = autoload(yourmodule, YourClass)
That won't work unless yourmodule and YourClass have already been
imported, since you'll
Jamesie Pic wrote:
obj = new yourmodule.YourClass()
This would also eliminate the need to manage an import list at
the beginning of a script in most case.
I like the fact that I can usually tell what modules a module
depends on by looking at the top for import statements.
If people were
On 3/3/2018 2:33 PM, Terry Reedy wrote:
On 3/3/2018 12:12 PM, Jamesie Pic wrote:
Hello everybody,
I thought perhaps we could allow the usage of a "new" keyword to
instanciate an object, ie:
obj = new yourmodule.YourClass()
In this case, it would behave the same as from yourmodule impor
On 3/3/2018 12:12 PM, Jamesie Pic wrote:
Hello everybody,
I thought perhaps we could allow the usage of a "new" keyword to
instanciate an object, ie:
obj = new yourmodule.YourClass()
In this case, it would behave the same as from yourmodule import
YourClass; obj = YourClass(), except t
On 03/03/2018 17:38, Eric V. Smith wrote:
I'd just do:
import yourmodule
obj = yourmodule.YourClass()
Or as one line, if that's your thing:
import yourmodule; obj = yourmodule.YourClass()
Which is
More transparent: it's evident what the imported module is used for.
More m
While i understand it would be harder to make it memory efficient, but this
is python not go, and also this sort feature could be easily optional,
also, it might even help against circular import issues, whoever hasn't
imported a module from inside a function in their life may throw the first
rock
On Sun, Mar 4, 2018 at 4:12 AM, Jamesie Pic wrote:
>
> Hello everybody,
>
> I thought perhaps we could allow the usage of a "new" keyword to instanciate
> an object, ie:
>
>obj = new yourmodule.YourClass()
>
> In this case, it would behave the same as from yourmodule import YourClass;
> obj =
On 3/3/2018 12:12 PM, Jamesie Pic wrote:
Hello everybody,
I thought perhaps we could allow the usage of a "new" keyword to
instanciate an object, ie:
obj = new yourmodule.YourClass()
I'd just do:
import yourmodule
obj = yourmodule.YourClass()
Or as one line, if that's your thi
Hello everybody,
I thought perhaps we could allow the usage of a "new" keyword to
instanciate an object, ie:
obj = new yourmodule.YourClass()
In this case, it would behave the same as from yourmodule import YourClass;
obj = YourClass(), except that it wouldn't need to be imported. This would
15 matches
Mail list logo