grscheller.untyped

Untyped Modules

Useful modules I found difficult to implement in a strictly typed manner. Not intended to be used with strictly typed code.

module grscheller.untyped.nothing

class Nothing()

Class representing a non-existent value.

  • nothing = Nothing() is a singleton
  • Nothing() instances should be compared with the is operator, not ==

instance variable: nothing

  • nothing: Nothing = Nothing() is a singleton

 1# Copyright 2024 Geoffrey R. Scheller
 2#
 3# Licensed under the Apache License, Version 2.0 (the "License");
 4# you may not use this file except in compliance with the License.
 5# You may obtain a copy of the License at
 6#
 7#     http://www.apache.org/licenses/LICENSE-2.0
 8#
 9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
15"""
16## Untyped Modules
17
18Useful modules I found difficult to implement in a strictly typed manner. Not
19intended to be used with strictly typed code.
20
21### module `grscheller.untyped.nothing`
22
23#### class `Nothing()`
24
25Class representing a non-existent value.
26
27* nothing = Nothing() is a singleton
28* Nothing() instances should be compared with the `is` operator, not `==`
29
30#### instance variable: `nothing`
31
32* nothing: Nothing = Nothing() is a singleton
33
34---
35
36"""
37__version__ = "0.2.0"
38__author__ = "Geoffrey R. Scheller"
39__copyright__ = "Copyright (c) 2024 Geoffrey R. Scheller"
40__license__ = "Apache License 2.0"