Is it possible to call a class but without a new instance created?

Jach Fong jfong at ms4.hinet.net
Tue Jun 19 00:22:33 EDT 2018


Ben Finney at 2018/6/19 PM 10:20 wrote:
> Jach Fong <jfong at ms4.hinet.net> 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 problem?
> 
No, I don't have any specific application in mind. This idea was just
triggered by a sentence in a Docstring in file font.py.

class Font:
     """Represents a named font.
     Constructor options are:
     ...
     exists -- does a named font by this name already exist?
        Creates a new named font if False, points to the existing font 
if True.
     ...
     """

But honestly I still don't know how it "points to the existing font":-(

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus




More information about the Python-list mailing list