back soft

مطالب مرتبط با «how to restrict object creation in» در back soft | نویسنده: استخدام کار

How restrict creation of objects of one class to instances of another in Python?

Vote count: 0 I have encountered a conundrum. I think I should know how to solve this — I even wrote a Python book — but I can't figure it out. It seems like what I am struggling with should be addressed by a design patte that is a variation on the factory theme, but I can't recall one. (At the end of this writeup I suggest a technical solution, but it seems an implausible one.) I hope you find this discussion interesting in its own right, but I look forward to hearing some suggestions for solut...

ادامه مطلب