From 875089349e6b4fada407a866409409944c17af14 Mon Sep 17 00:00:00 2001 From: Gourav Kumar Date: Tue, 29 Mar 2022 10:35:20 +0530 Subject: [PATCH] Added typehints for head and tail --- fincal/core.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fincal/core.py b/fincal/core.py index 99b5cbd..8269c97 100644 --- a/fincal/core.py +++ b/fincal/core.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime import inspect from collections import UserDict, UserList @@ -423,12 +425,12 @@ class TimeSeriesCore(UserDict): return _IndexSlicer(self) - def head(self, n: int = 6): + def head(self, n: int = 6) -> TimeSeriesCore: """Returns the first n items of the TimeSeries object""" return self.iloc[:n] - def tail(self, n: int = 6): + def tail(self, n: int = 6) -> TimeSeriesCore: """Returns the last n items of the TimeSeries object""" return self.iloc[-n:]