Skip to main content
Basilisk Basilisk
  • Docs
  • Rules
  • Blog
  • GitHub
  • Introduction
  • Installation
  • Quick Start
  • Configuration
  • Debugging
  • Rules
    • Missing Annotations
    • Type Safety
    • Ownership Safety
    • Immutability
    • Structural Discipline
    • Coercion Safety
    • Optional Safety
    • Unused Code
    • Code Quality
  • Comparison
  • Migration
  • Mojo Safety
  • README

Optional Safety — E0070–E0073

← Coercion Safety | Next: Unused Code →


BSK-E0070 — Attribute access on Optional

A method or attribute is accessed on a value that may be None.

def get_name(user: User | None) -> str:
    return user.name  # Error — user may be None

BSK-E0071 — Optional passed where non-Optional expected


BSK-E0072 — Optional returned where non-Optional declared


BSK-E0073 — Comparison with None without narrowing

Product

  • Documentation
  • Rules Reference
  • Blog

Community

  • GitHub
  • Issues
  • Discussions

Legal

  • MIT / Apache-2.0

© 2026 NIMBLESITE PTY LTD