it is easy to see what needs to be done when we want to add support for more countriescreate the new formatter classes and the abstract factory itself bear in mind that formatter classes might be reusedfor examplecanada formats its currency the same way as the usabut its date format is more sensible than its southern neighbor abstract factories often return singleton objectbut this is not requiredin our codeit' returning new instance of each formatter every time it' called there' no reason the formatters couldn' be stored as instance variables and the same instance returned for each factory looking back at these exampleswe see thatonce againthere appears to be lot of boilerplate code for factories that just doesn' feel necessary in python oftenthe requirements that might call for an abstract factory can be more easily fulfilled by using separate module for each factory type (for examplethe usa and france)and then ensuring that the correct module is being accessed in factory module the package structure for such modules might look like thislocalize__init__ py backends__init__ py usa py france py the trick is that __init__ py in the localize package can contain logic that redirects all requests to the correct backend there is variety of ways this could be done if we know that the backend is never going to change dynamically (that iswithout restart)we can just put some if statements in __init__ py that check the current country codeand use the usually unacceptable from backends usa import syntax to import all variables from the appropriate backend orwe could import each of the backends and set current_backend variable to point at specific modulefrom backends import usafrance if country_code ="us"current_backend usa depending on which solution we chooseour client code would have to call either localize format_date or localize current_backend format_date to get date formatted in the current country' locale the end result is much more pythonic than the original abstract factory patternandin typical usagejust as flexible