From 1d0eeff419b6ee64ac17c9f650e287ff24342c1f Mon Sep 17 00:00:00 2001 From: Jeremy Singer-Vine Date: Sun, 18 Aug 2024 19:27:36 -0400 Subject: [PATCH] Quickfix for Python 3.8 type hint issue --- CHANGELOG.md | 6 ++++++ pdfplumber/table.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6fb68ea..e901c985 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/). +## [0.11.4] - [unreleased] + +### Fixed + +- Fix one type hint so that it doesn't throw error on Python 3.8 (h/t @andrekeller). ([#1184](https://github.com/jsvine/pdfplumber/issues/1184)) + ## [0.11.3] - 2024-08-07 ### Added diff --git a/pdfplumber/table.py b/pdfplumber/table.py index e032f681..0ba4445c 100644 --- a/pdfplumber/table.py +++ b/pdfplumber/table.py @@ -1,7 +1,7 @@ import itertools from dataclasses import dataclass from operator import itemgetter -from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple, Union +from typing import TYPE_CHECKING, Any, Dict, List, Optional, Set, Tuple, Type, Union from . import utils from ._typing import T_bbox, T_num, T_obj, T_obj_iter, T_obj_list, T_point @@ -389,7 +389,7 @@ def bbox(self) -> T_bbox: max(map(itemgetter(3), c)), ) - def _get_rows_or_cols(self, kind: type[CellGroup]) -> List[CellGroup]: + def _get_rows_or_cols(self, kind: Type[CellGroup]) -> List[CellGroup]: axis = 0 if kind is Row else 1 antiaxis = int(not axis)