Edge Rewrite
// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21b61e95eb92308

Jump to content

Talk:Factory (object-oriented programming)

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 5 years ago by Antchal in topic Incorrect code of function
[edit]

In the phrase "concrete type", the word 'concrete' has been wikified, but this links it to the page concrete, which is hardly appropriate. It's not quite clear what article it should link to; the nearest I can come up with is Abstraction_(computer_science), which unfortunately doesn't mention the antonym 'concrete' until the 'Considerations' section. For now, I've pointed it at the disambiguation page. 131.111.202.32 (talk) 11:44, 18 January 2011 (UTC)Reply

A

Incorrect code of function

[edit]

Functions don't have attributes (at least in Python). So, f.obj is incorrect here.

def f():
    if f.obj is None:
        f.obj = A()
    return f.obj

PS: I don't know singleton pattern so can't edit the implementation.Antchal (talk) 09:06, 29 June 2021 (UTC)Reply