GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — sippycup/example.py at master · mspandit/sippycup

Expand file tree

/

example.py

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
33 lines (29 loc) · 1.22 KB
/

example.py

Copy path

File metadata and controls

33 lines (29 loc) · 1.22 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
__author__ = "Bill MacCartney"
__copyright__ = "Copyright 2015, Bill MacCartney"
__credits__ = []
__license__ = "GNU General Public License, version 2.0"
__version__ = "0.9"
__maintainer__ = "Bill MacCartney"
__email__ = "See the author's website"
class Example:
def __init__(self, input=None, parse=None, semantics=None, denotation=None):
self.input = input
self.parse = parse
self.semantics = semantics
self.denotation = denotation
def __str__(self):
fields = []
self.input != None and fields.append('input=\'%s\'' % self.input.replace("'", "\'"))
self.parse != None and fields.append('parse=%s' % self.parse)
self.semantics != None and fields.append('semantics=%s' % str(self.semantics))
self.denotation != None and fields.append('denotation=%s' % str(self.denotation))
return 'Example(%s)' % (', '.join(fields))
if __name__ == '__main__':
examples = [
Example(),
Example(input='one plus one', semantics='(+ 1 1)', denotation=2),
Example(input='two plus three', denotation=5),
Example(input='utah', semantics='/state/utah', denotation=set(['/state/utah'])),
]
for example in examples:
print(example)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.