Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The examples provided here cant be real, right? Like look at the MathUtils one. No one is so braindead that they would add 2 redundant lines on top of their function def right?


Correct, the examples here are not real. They are examples.


> No one is so braindead that they would add 2 redundant lines on top of their function def right?

Apparently Grant Sanderson (3Blue1Brown), the creator of Manim, is braindead:

  class ContinuousMotion(Scene):
      def construct(self):
          func = lambda pos: np.sin(pos[0] / 2) * UR + np.cos(pos[1] / 2) * LEFT
          stream_lines = StreamLines(func, stroke_width=2, max_anchors_per_line=30)
          self.add(stream_lines)
          stream_lines.start_animation(warm_up=False, flow_speed=1.5)
          self.wait(stream_lines.virtual_time / stream_lines.flow_speed)


This isnt the same thing. This is leveraging inheritance. The mathutils example isnt. If the example is supposed to include cases where inheritance is being used and the parent classes methods are important to the child class functioning, then the point in the op is not as valid anymore




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: