Lichen

lib/__builtins__/exception/naming.py

858:8f8361de472a
2018-07-21 Paul Boddie Invocations in parameter lists may require temporary storage for contexts and accessors, but the storage locations must be different. Otherwise, the code will generate a sequence-point warning. Here, distinct ranges for parameters in lists are introduced, and accessors are now also stored in arrays, permitting distinct storage.
     1 #!/usr/bin/env python     2      3 """     4 Name-related exception objects.     5      6 Errors regarding unrecognised names or import failures are not provided since     7 these errors should occur during program compilation.     8      9 Copyright (C) 2015, 2016, 2018 Paul Boddie <paul@boddie.org.uk>    10     11 This program is free software; you can redistribute it and/or modify it under    12 the terms of the GNU General Public License as published by the Free Software    13 Foundation; either version 3 of the License, or (at your option) any later    14 version.    15     16 This program is distributed in the hope that it will be useful, but WITHOUT    17 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    18 FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more    19 details.    20     21 You should have received a copy of the GNU General Public License along with    22 this program.  If not, see <http://www.gnu.org/licenses/>.    23 """    24     25 class AttributeError(Exception):    26     27     "An error indicating an invalid attribute for an object."    28     29     def __init__(self, .name):    30     31         "Initialise the exception with the given 'name'."    32     33         pass    34     35 # vim: tabstop=4 expandtab shiftwidth=4