8000 Issue with `|` in typing with Python3.9 · Issue #209 · Dioptas/Dioptas · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Issue with | in typing with Python3.9 #209
Open
@t20100

Description

@t20100

Python<=3.9 does not support | in typing which is used at different places:

dioptas/model/PatternModel.py", line 146, in PatternModel
    def background_pattern(self, pattern: Pattern | None):
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
dioptas/model/OverlayModel.py", line 42, in Overlay
    self, x: np.ndarray | None = None, y: np.ndarray | None = None, name: str = ""
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
dioptas/controller/MapController.py", line 384, in MapController
    self, x: float, current_unit: str | None = None
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

This can be fixed by adding from __future__ import annotations as the first line of code of those files, or by dropping support of Python<3.10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0