Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6158579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T20:58:49+00:00 2026-05-23T20:58:49+00:00

Since Python is a duck-typed language is writing factory classes meaningless in Python? http://en.wikipedia.org/wiki/Factory_method_pattern

  • 0

Since Python is a duck-typed language is writing factory classes meaningless in Python?
http://en.wikipedia.org/wiki/Factory_method_pattern

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T20:58:51+00:00Added an answer on May 23, 2026 at 8:58 pm

    While there may be times when the factory pattern is unnecessary where it may be required in other languages, there are still times when it would be valid to use it – it might just be a way of making your API cleaner – for example as a way of preventing duplication of code that decides which of a series of subclasses to return.

    From the Wikipedia article you linked:

    Use the factory pattern when:

    • The creation of the object precludes reuse without significantly duplicating code.
    • The creation of the object requires access to information or resources not appropriate to contain within the composing object.
    • The lifetime management of created objects needs to be centralised to ensure consistent behavior.

    All of these can still apply when the language is duck typed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since Python is a dynamic, interpreted language you don't have to compile your code
Since functions are values in Python, how do I determine if the variable is
I want a Python object that will monitor whether other objects have changed since
I have a simple python program that I'd like to daemonize. Since the point
It's been a while since I programmed in C++, and after coming from python,
I want to start coding in Python or Ruby. Since I own a Lego
Since Python does not provide left/right versions of its comparison operators, how does it
I setup PyDev with this path for the python interpreter /System/Library/Frameworks/Python.framework/Versions/2.5/Python since the one
The python statvfs module was marked as deprecated since python 2.6 and it's now
I want to implement my project using interface oriented programming. Since Python itself does

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.