Re: Metaclasses - magic functions

2016-12-23 Thread Mr. Wrobel
W dniu 23.12.2016 o 15:14, Ian Kelly pisze: (...) cls.added_in_init = 'test' Man, you are awsome genius! Finally somebody was able to explain me what is the power of __new__ and difference between __init__ !!! So what I wanted to achieve was adding some new attributes to the class

Re: Metaclasses - magic functions

2016-12-23 Thread Mr. Wrobel
W dniu 21.12.2016 o 02:51, Ethan Furman pisze: On 12/20/2016 03:39 PM, Ben Finney wrote: "Mr. Wrobel" writes: Quick question, can anybody tell me when to use __init__ instead of __new__ in meta programming? Use ‘__new__’ to do the work of *creating* one instance from nothing;

Metaclasses - magic functions

2016-12-20 Thread Mr. Wrobel
Hi, Quick question, can anybody tell me when to use __init__ instead of __new__ in meta programming? I see that __new__ can be used mostly when I want to manipulate with class variables that are stored into dictionary. But when to use __init__? Any example? Thanx, M --

Re: [Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Mr. Wrobel
W dniu 05.11.2016 o 22:17, Ben Bacarisse pisze: Steve D'Aprano <steve+pyt...@pearwood.info> writes: On Sun, 6 Nov 2016 04:10 am, Mr. Wrobel wrote: Hi, Some skeptics asked my why there is a reason to use Python against of any other "not interpreted" languages, like objec

[Theory] How to speed up python code execution / pypy vs GPU

2016-11-05 Thread Mr. Wrobel
Hi, Some skeptics asked my why there is a reason to use Python against of any other "not interpreted" languages, like objective-C. As my explanation, I have answered that there is a a lot of useful APIs, language is modern, has advanced objective architecture, and what is the most important

Re: Meta classes - real example

2016-10-20 Thread Mr. Wrobel
W dniu 18.10.2016 o 16:42, Ethan Furman pisze: On 10/17/2016 11:44 PM, Mr. Wrobel wrote: Ok,so in general, we could say that using Metclasses is ok for manipulating __new__ but not that what is setting by __init__. Am I right? No and yes. In this code (python 2 syntax): #untested class

Re: Meta classes - real example

2016-10-18 Thread Mr. Wrobel
W dniu 17.10.2016 o 23:23, Ethan Furman pisze: On 10/17/2016 09:23 AM, Mr. Wrobel wrote: W dniu 17.10.2016 o 18:16, Chris Angelico pisze: On Tue, Oct 18, 2016 at 3:03 AM, Mr. Wrobel wrote: I am looking for an example of metaclass usage. Especially I am interestet in manipulating instance

Re: Meta classes - real example

2016-10-17 Thread Mr. Wrobel
W dniu 17.10.2016 o 18:16, Chris Angelico pisze: On Tue, Oct 18, 2016 at 3:03 AM, Mr. Wrobel <m...@e-wrobel.pl> wrote: Hi, I am looking for an example of metaclass usage. Especially I am interestet in manipulating instance variables, for example: My class: class MrMeta(type):

Meta classes - real example

2016-10-17 Thread Mr. Wrobel
? Thanks! Mr. Wrobel -- https://mail.python.org/mailman/listinfo/python-list