diff --git a/canvasapi/paginated_list.py b/canvasapi/paginated_list.py
index 21cceaa..90ceade 100644
--- a/canvasapi/paginated_list.py
+++ b/canvasapi/paginated_list.py
@@ -11,6 +11,8 @@ class PaginatedList(object):
     def __getitem__(self, index):
         assert isinstance(index, (int, slice))
         if isinstance(index, int):
+            if index < 0:
+                raise IndexError("Cannot negative index a PaginatedList")
             self._get_up_to_index(index)
             return self._elements[index]
         else:
@@ -105,6 +107,9 @@ class PaginatedList(object):
             self._stop = the_slice.stop
             self._step = the_slice.step or 1
 
+            if self._start < 0 or self._stop < 0:
+                raise IndexError("Cannot negative index a PaginatedList slice")
+
         def __iter__(self):
             index = self._start
             while not self._finished(index):

Negative index on PaginatedList causes unexpected results
# Describe the bug

It is expected that you cannot negative-index the PaginatedList due to its inability to know its length until it is full. However, it is still possible to use the negative index if at least one page of results has been loaded. When this happens, the list returns the last value it has loaded (which is not necessarily the last value it can load).

# To Reproduce

Steps to reproduce the behavior:

```python
users = canvas.get_course(1).get_users()
users[1]
users[-1]
```

# Expected behavior

I am not allowed to use negative indexing (wishlist, I *can* use negative indexing :D)

# Environment information (please complete the following information)

- Python 3.7.0
- CanvasAPI 0.14.0

# Additional context

I'll try my hand at fixing this.

diff --git a/tests/test_paginated_list.py b/tests/test_paginated_list.py
index 570faa8..99fa473 100644
--- a/tests/test_paginated_list.py
+++ b/tests/test_paginated_list.py
@@ -170,3 +170,36 @@ class TestPaginatedList(unittest.TestCase):
         )
 
         self.assertIsInstance(pag_list[0], EnrollmentTerm)
+
+    def test_negative_index(self, m):
+        # Regression test for https://github.com/ucfopen/canvasapi/issues/305
+        # Ensure that we can't use negative indexing, even after loading a page
+
+        register_uris({"paginated_list": ["4_2_pages_p1", "4_2_pages_p2"]}, m)
+        pag_list = PaginatedList(User, self.requester, "GET", "four_objects_two_pages")
+        pag_list[0]
+
+        with self.assertRaises(IndexError):
+            pag_list[-1]
+
+    def test_negative_index_for_slice_start(self, m):
+        # Regression test for https://github.com/ucfopen/canvasapi/issues/305
+        # Ensure that we can't slice using a negative index as the start item
+
+        register_uris({"paginated_list": ["4_2_pages_p1", "4_2_pages_p2"]}, m)
+        pag_list = PaginatedList(User, self.requester, "GET", "four_objects_two_pages")
+        pag_list[0]
+
+        with self.assertRaises(IndexError):
+            pag_list[-1:1]
+
+    def test_negative_index_for_slice_end(self, m):
+        # Regression test for https://github.com/ucfopen/canvasapi/issues/305
+        # Ensure that we can't slice using a negative index as the end item
+
+        register_uris({"paginated_list": ["4_2_pages_p1", "4_2_pages_p2"]}, m)
+        pag_list = PaginatedList(User, self.requester, "GET", "four_objects_two_pages")
+        pag_list[0]
+
+        with self.assertRaises(IndexError):
+            pag_list[:-1]

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
3.6
dev_requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
black==22.8.0
-e git+https://github.com/ucfopen/canvasapi.git@3ef34a89d63aa7461a079bc271944ad1f7ef5099#egg=canvasapi
certifi==2021.5.30
cfgv==3.3.1
charset-normalizer==2.0.12
click==8.0.4
coverage==6.2
dataclasses==0.8
distlib==0.3.9
docutils==0.15.2
filelock==3.4.1
flake8==5.0.4
identify==2.4.4
idna==3.10
imagesize==1.4.1
importlib-metadata==4.2.0
importlib-resources==5.2.3
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
mccabe==0.7.0
mypy-extensions==1.0.0
nodeenv==1.6.0
packaging==21.3
pathspec==0.9.0
platformdirs==2.4.0
pluggy==1.0.0
pre-commit==2.17.0
py==1.11.0
pycodestyle==2.9.1
pyflakes==2.5.0
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytz==2025.2
PyYAML==6.0.1
requests==2.27.1
requests-mock==1.12.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==4.3.2
sphinx-rtd-theme==1.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
toml==0.10.2
tomli==1.2.3
typed-ast==1.5.5
typing_extensions==4.1.1
urllib3==1.26.20
virtualenv==20.16.2
zipp==3.6.0

name: canvasapi
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - black==22.8.0
      - cfgv==3.3.1
      - charset-normalizer==2.0.12
      - click==8.0.4
      - coverage==6.2
      - dataclasses==0.8
      - distlib==0.3.9
      - docutils==0.15.2
      - filelock==3.4.1
      - flake8==5.0.4
      - identify==2.4.4
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.2.0
      - importlib-resources==5.2.3
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - mccabe==0.7.0
      - mypy-extensions==1.0.0
      - nodeenv==1.6.0
      - packaging==21.3
      - pathspec==0.9.0
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - pre-commit==2.17.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pyflakes==2.5.0
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytz==2025.2
      - pyyaml==6.0.1
      - requests==2.27.1
      - requests-mock==1.12.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==4.3.2
      - sphinx-rtd-theme==1.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - toml==0.10.2
      - tomli==1.2.3
      - typed-ast==1.5.5
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - virtualenv==20.16.2
      - zipp==3.6.0
prefix: /opt/conda/envs/canvasapi

tests/test_paginated_list.py::TestPaginatedList::test_negative_index tests/test_paginated_list.py::TestPaginatedList::test_negative_index_for_slice_end tests/test_paginated_list.py::TestPaginatedList::test_negative_index_for_slice_start
tests/test_paginated_list.py::TestPaginatedList::test_getitem_first tests/test_paginated_list.py::TestPaginatedList::test_getitem_second_page tests/test_paginated_list.py::TestPaginatedList::test_iterator tests/test_paginated_list.py::TestPaginatedList::test_paginated_list_empty tests/test_paginated_list.py::TestPaginatedList::test_paginated_list_four_two_pages tests/test_paginated_list.py::TestPaginatedList::test_paginated_list_single tests/test_paginated_list.py::TestPaginatedList::test_paginated_list_six_three_pages tests/test_paginated_list.py::TestPaginatedList::test_paginated_list_two_one_page tests/test_paginated_list.py::TestPaginatedList::test_repr tests/test_paginated_list.py::TestPaginatedList::test_root_element tests/test_paginated_list.py::TestPaginatedList::test_root_element_incorrect tests/test_paginated_list.py::TestPaginatedList::test_slice_beginning tests/test_paginated_list.py::TestPaginatedList::test_slice_end tests/test_paginated_list.py::TestPaginatedList::test_slice_middle tests/test_paginated_list.py::TestPaginatedList::test_slice_out_of_bounds tests/test_paginated_list.py::TestPaginatedList::test_slice_oversize
canvasapi/paginated_list.py
canvasapi/paginated_list.py