From f4c6d1030a4c4f99991680df6dac5133b89036ba Mon Sep 17 00:00:00 2001 From: Eric Atkin Date: Mon, 29 Jan 2024 10:23:41 -0700 Subject: [PATCH] Use pyramid.util.Sentinel and update changelog --- CHANGES.rst | 3 +++ src/pyramid/config/views.py | 4 ++-- src/pyramid/view.py | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 46f7fbc18..96eb1dfc6 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -11,6 +11,9 @@ Features - Coverage reports in tests based on Python 3.11 instead of Python 3.8. +- Added `LIFT` sentinel value that may be used for context and name arguments + to view_config on class methods in conjunction with venusian lift. + Bug Fixes --------- diff --git a/src/pyramid/config/views.py b/src/pyramid/config/views.py index 0b1d3abc5..a6594e607 100644 --- a/src/pyramid/config/views.py +++ b/src/pyramid/config/views.py @@ -573,8 +573,8 @@ def wrapper(context, request): The :term:`view name`. Read :ref:`traversal_chapter` to understand the concept of a view name. When :term:`view` is a class, - the sentinel value view.LIFT will cause the :term:`attr` value to be - copied to name (useful with view_defaults to reduce boilerplate). + the sentinel value view.LIFT will cause the attr value to be copied + to name (useful with view_defaults to reduce boilerplate). context diff --git a/src/pyramid/view.py b/src/pyramid/view.py index 0f96fb774..0622efae7 100644 --- a/src/pyramid/view.py +++ b/src/pyramid/view.py @@ -20,10 +20,10 @@ IViewClassifier, ) from pyramid.threadlocal import get_current_registry, manager -from pyramid.util import hide_attrs, reraise as reraise_ +from pyramid.util import Sentinel, hide_attrs, reraise as reraise_ _marker = object() -LIFT = object() +LIFT = Sentinel('LIFT') def render_view_to_response(context, request, name='', secure=True):