Jim Lee at 2018/6/19 PM 03:44 wrote:
On 06/18/2018 09:22 PM, Jach Fong wrote:
Ben Finney at 2018/6/19 PM 10:20 wrote:
Jach Fong writes:
Although it passed the first examination, I have no idea if it can
work correctly in the real application:-)
Neither do I. What is the real-world proble
On 06/18/2018 09:22 PM, Jach Fong wrote:
Ben Finney at 2018/6/19 PM 10:20 wrote:
Jach Fong writes:
Although it passed the first examination, I have no idea if it can
work correctly in the real application:-)
Neither do I. What is the real-world problem you are trying to solve?
Why do you
Ben Finney at 2018/6/19 PM 10:20 wrote:
Jach Fong writes:
Although it passed the first examination, I have no idea if it can
work correctly in the real application:-)
Neither do I. What is the real-world problem you are trying to solve?
Why do you think this (and not some more idiomatic Pyth
Jach Fong writes:
> Although it passed the first examination, I have no idea if it can
> work correctly in the real application:-)
Neither do I. What is the real-world problem you are trying to solve?
Why do you think this (and not some more idiomatic Python feature) is
needed for solving that p
Ben Finney at 2018/6/18 PM 03:29 wrote:
Jach Fong writes:
I also make a test of my own and it fails too.
class A:
... objs = []
... def __init__(self, exists=False):
... if exists: self = self.objs[0]
The function parameters (bound here to the names ‘self’, ‘exists’)
It seems most of confusion comes from mixing up python object and tk
widgets, and ignored that the tkinter is really a python-tk-interface.
Thank you for pointing it out.
Terry Reedy at 2018/6/18 PM 05:19 wrote:
To answer the question of the title, which is a bit different from the
question in
On Mon, Jun 18, 2018 at 5:17 PM, Vincent Vande Vyvre
wrote:
> What you try to do is called a /singleton./
In this case, not necessarily a singleton, but returning a cached
object that's the same for any given argument. Basically, interned
objects. But yes, the same idea.
ChrisA
--
https://mail.
Le 18/06/18 à 06:48, Jach Fong a écrit :
After looking into the \tkiniter\font.py source file, triggered by Jim's
hint on my previous subject "Why an object changes its "address" between
adjacent calls?", I get more confused.
Below was quoted from the font.py:
def nameto
To answer the question of the title, which is a bit different from the
question in the text, yes. type(None)() always returns the singleton
None object. (And one can write a singleton class in Python also.)
bool() always returns one of False or True. int() and str() may return
either a new o
On 6/18/2018 12:48 AM, Jach Fong wrote:
After looking into the \tkiniter\font.py source file, triggered by Jim's
hint on my previous subject "Why an object changes its "address" between
adjacent calls?", I get more confused.
Below was quoted from the font.py:
def nametof
Jach Fong wrote:
> Is it possible to call a class but without a new instance created?
Yes, this is possible in Python, by writing a custom __new__ method. An
extreme example:
>>> class Three:
... def __new__(*args): return 3
...
>>> a = Three()
>>> b = Thre
Jach Fong writes:
> I also make a test of my own and it fails too.
>
> >>> class A:
> ... objs = []
> ... def __init__(self, exists=False):
> ... if exists: self = self.objs[0]
The function parameters (bound here to the names ‘self’, ‘exists’) are
in the local function scope
On Mon, Jun 18, 2018 at 2:48 PM, Jach Fong wrote:
> After looking into the \tkiniter\font.py source file, triggered by Jim's
> hint on my previous subject "Why an object changes its "address" between
> adjacent calls?", I get more confused.
>
> Below was quoted from the font.py:
>
After looking into the \tkiniter\font.py source file, triggered by Jim's
hint on my previous subject "Why an object changes its "address" between
adjacent calls?", I get more confused.
Below was quoted from the font.py:
def nametofont(name):
"""Given the name of a tk
14 matches
Mail list logo