Geometry2D | helper classes for 2D geometric calculations | 3D Animation library
kandi X-RAY | Geometry2D Summary
kandi X-RAY | Geometry2D Summary
A set of 2D Geometric helper components and structs for Unity3D. All structs are immutable. Useful for many things including calculating intersections, projections, distances and lerping.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Geometry2D
Geometry2D Key Features
Geometry2D Examples and Code Snippets
Community Discussions
Trending Discussions on Geometry2D
QUESTION
I'm reading Pro Python 3. There in chapter 4 classes super()
and its pitfalls is explained, with the final conclusion: "the only defense against such problems is an agreement among all classes involved to not change method signatures"
Sadly I'm not sure what that means. Wouldn't this kill the purpose of subclassing? Or how would be the "pythonic" way to do the following without changing the signature of __init__
?:
ANSWER
Answered 2019-Oct-05 at 22:49The reason to not change method signatures in subclasses is so that you can take an instance of class Foo
and call methods of Foo
on that instance without needing to know the exact subclass to know what arguments to pass.
That doesn't apply to __init__
(except in multiple inheritance, which is one of the reasons it's so easy to get multiple inheritance wrong). You always know what __init__
you're going to invoke (except in multiple inheritance), so changing the signature of __init__
in a subclass is fine (except in multiple inheritance).
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Geometry2D
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page