From f06de0a4f67f9efa86ec588015c3c2b695127fa0 Mon Sep 17 00:00:00 2001 From: Anthony Plunkett Date: Fri, 18 May 2018 12:20:27 -0400 Subject: [PATCH] Use an explicit sentinel. --- flask/blueprints.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/flask/blueprints.py b/flask/blueprints.py index 10a952bb..2e06cf4b 100644 --- a/flask/blueprints.py +++ b/flask/blueprints.py @@ -14,6 +14,9 @@ from werkzeug.urls import url_join from .helpers import _PackageBoundObject, _endpoint_from_view_func +# a singleton sentinel value for parameter defaults +_sentinel = object() + class BlueprintSetupState(object): """Temporary holder object for registering a blueprint with the @@ -118,7 +121,7 @@ class Blueprint(_PackageBoundObject): def __init__(self, name, import_name, static_folder=None, static_url_path=None, template_folder=None, url_prefix=None, subdomain=None, url_defaults=None, - root_path=None, cli_group=-1): + root_path=None, cli_group=_sentinel): _PackageBoundObject.__init__(self, import_name, template_folder, root_path=root_path) self.name = name @@ -190,7 +193,7 @@ class Blueprint(_PackageBoundObject): cli_resolved_group = options.get('cli_group', self.cli_group) if cli_resolved_group is None: app.cli.commands.update(self.cli.commands) - elif cli_resolved_group == -1: + elif cli_resolved_group is _sentinel: self.cli.name = self.name app.cli.add_command(self.cli) else: