Fixing “None” Not Callable Error in Mypy

Photo by David Travis on Unsplash
status = {Bishop: self.validate_move_bishop,
King: self.validate_move_king,
Knight: self.validate_move_knight,
Pawn: self.validate_move_pawn,
Queen: self.validate_move_queen,
Rook: self.validate_move_rook,
}.get(type(self._board[start]))(start, end)
status = {...}.get(type(self._board[start]),
lambda *args: False)(start, end)

--

--

--

C.D. Reimer makes topical videos about comic cons, pop culture, Silicon Valley and technology on YouTube. https://www.youtube.com/cdreimer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Endpoint Testing with EEQL

Why Map and Filter Aren’t Really Functions in Python?

The importance of team culture

Testcode 2.0 “My Experience”

Beta testing for TotemFi’s prediction markets platform is open to applications!

Cracking the Coding Bootcamp: How to Succeed After the Hurricane

Default Terminal in VSCode (zsh, bash)

Makefiles from the ground up

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
C.D. Reimer

C.D. Reimer

C.D. Reimer makes topical videos about comic cons, pop culture, Silicon Valley and technology on YouTube. https://www.youtube.com/cdreimer

More from Medium

My First Impression Using Software Ideas Modeler UML Modeling Tool for C++

Embedded consulting tips: C is not the only programming language

Building a Continuous Integration Workflow for CUDA Applications on Windows

Temperature Control | Embedded Systems