Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,194,827 members, 7,956,138 topics. Date: Monday, 23 September 2024 at 04:51 AM |
Nairaland Forum / Science/Technology / Programming / How Do I Implement This In Python ?? (662 Views)
How Can I Implement Previous And Next Page In Handlebars / How Do I Implement A Contact Page In ASP.NET/C#? / Who Can Implement This On SPC4 *image Inside* (2) (3) (4)
How Do I Implement This In Python ?? by shegzhkn: 1:53pm On Aug 04, 2020 |
Python is an object oriented programming language along side language like Java, C++, C#, etc one of the concept of OOP is polymorphism allowing object to be created in different form. Now here is the real deal, Java support Constructor overloading the same for C# but you have to be creative to do that in python say use of default value in the init method. But i needed to create an object of a class in different form and using default value will not cut it or make it work the way i wanted it to. So can I create another class with similar logic with slight discrepancies from the former and i am considering efficiency here. Thanks |
Re: How Do I Implement This In Python ?? by Shepherdd(m): 2:53pm On Aug 04, 2020 |
shegzhkn: Python supports polymorphism very well (almost), could you post a snippet of what you are trying to do in java or elaborate further. |
Re: How Do I Implement This In Python ?? by shegzhkn: 3:02pm On Aug 04, 2020 |
Shepherdd: How ?, elaborate. |
Re: How Do I Implement This In Python ?? by Shepherdd(m): 3:17pm On Aug 04, 2020 |
shegzhkn: Most of the time **kwargs will be sufficient, and if you need overloading based on compile time differentiation of objects, read about python single dispatch on Google. |
Re: How Do I Implement This In Python ?? by shegzhkn: 3:56pm On Aug 04, 2020 |
Shepherdd: Tried that my friend, thanks i appreciate your input. Gracias |
Re: How Do I Implement This In Python ?? by Shepherdd(m): 6:05pm On Aug 04, 2020 |
shegzhkn: Ok. This library could also be of help if you need something similar to Java's overloading. https://github.com/mrocklin/multipledispatch |
Re: How Do I Implement This In Python ?? by shegzhkn: 11:03am On Aug 05, 2020 |
Shepherdd: Thanks boss i really appreciate. |
(1) (Reply)
CSS Is Not A Programming Language? / I Need A Programmer / Bootstrap Modal Not Working.
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 13 |