blob: b0e3da93057b20db75e584a26c9c519114d9c323 [file] [log] [blame]
Guido van Rossum3bead091992-01-27 17:00:37 +00001# Python test set -- part 1, grammar.
2# This just tests whether the parser accepts them all.
3
4from test_support import *
5
6print '1. Parser'
7
8print '1.1 Tokens'
9
10print '1.1.1 Backslashes'
11
12# Backslash means line continuation:
13x = 1 \
14+ 1
15if x <> 2: raise TestFailed, 'backslash for line continuation'
16
17# Backslash does not means continuation in comments :\
18x = 0
19if x <> 0: raise TestFailed, 'backslash ending comment'
20
21print '1.1.2 Numeric literals'
22
23print '1.1.2.1 Plain integers'
24if 0xff <> 255: raise TestFailed, 'hex int'
25if 0377 <> 255: raise TestFailed, 'octal int'
Guido van Rossumdd8cb441993-12-29 15:33:08 +000026if 2147483647 != 017777777777: raise TestFailed, 'large positive int'
27try:
28 from sys import maxint
29except ImportError:
30 maxint = 2147483647
31if maxint == 2147483647:
Guido van Rossume65cce51993-11-08 15:05:21 +000032 if -2147483647-1 != 020000000000: raise TestFailed, 'max negative int'
33 # XXX -2147483648
34 if 037777777777 != -1: raise TestFailed, 'oct -1'
35 if 0xffffffff != -1: raise TestFailed, 'hex -1'
36 for s in '2147483648', '040000000000', '0x100000000':
37 try:
38 x = eval(s)
39 except OverflowError:
40 continue
Guido van Rossum51b1c1c1995-03-04 22:30:54 +000041## raise TestFailed, \
42 print \
Guido van Rossume65cce51993-11-08 15:05:21 +000043 'No OverflowError on huge integer literal ' + `s`
Guido van Rossumdd8cb441993-12-29 15:33:08 +000044elif eval('maxint == 9223372036854775807'):
Guido van Rossumb6775db1994-08-01 11:34:53 +000045 if eval('-9223372036854775807-1 != 01000000000000000000000'):
Guido van Rossumdd8cb441993-12-29 15:33:08 +000046 raise TestFailed, 'max negative int'
47 if eval('01777777777777777777777') != -1: raise TestFailed, 'oct -1'
48 if eval('0xffffffffffffffff') != -1: raise TestFailed, 'hex -1'
49 for s in '9223372036854775808', '02000000000000000000000', \
50 '0x10000000000000000':
51 try:
52 x = eval(s)
53 except OverflowError:
54 continue
55 raise TestFailed, \
56 'No OverflowError on huge integer literal ' + `s`
57else:
58 print 'Weird maxint value', maxint
Guido van Rossum3bead091992-01-27 17:00:37 +000059
60print '1.1.2.2 Long integers'
61x = 0L
62x = 0l
63x = 0xffffffffffffffffL
64x = 0xffffffffffffffffl
65x = 077777777777777777L
66x = 077777777777777777l
67x = 123456789012345678901234567890L
68x = 123456789012345678901234567890l
69
70print '1.1.2.3 Floating point'
71x = 3.14
72x = 314.
73x = 0.314
74# XXX x = 000.314
75x = .314
76x = 3e14
77x = 3E14
78x = 3e-14
79x = 3e+14
80x = 3.e14
81x = .3e14
82x = 3.1e4
83
Guido van Rossumb31c7f71993-11-11 10:31:23 +000084print '1.1.3 String literals'
85
Guido van Rossum505043f1997-04-16 00:27:45 +000086##def assert(s):
87## if not s: raise TestFailed, 'see traceback'
Guido van Rossumb31c7f71993-11-11 10:31:23 +000088
89x = ''; y = ""; assert(len(x) == 0 and x == y)
90x = '\''; y = "'"; assert(len(x) == 1 and x == y and ord(x) == 39)
91x = '"'; y = "\""; assert(len(x) == 1 and x == y and ord(x) == 34)
92x = "doesn't \"shrink\" does it"
93y = 'doesn\'t "shrink" does it'
94assert(len(x) == 24 and x == y)
Guido van Rossumb6775db1994-08-01 11:34:53 +000095x = "does \"shrink\" doesn't it"
96y = 'does "shrink" doesn\'t it'
97assert(len(x) == 24 and x == y)
98x = """
99The "quick"
100brown fox
101jumps over
102the 'lazy' dog.
103"""
104y = '\nThe "quick"\nbrown fox\njumps over\nthe \'lazy\' dog.\n'
105assert(x == y)
106y = '''
107The "quick"
108brown fox
109jumps over
110the 'lazy' dog.
111'''; assert(x == y)
112y = "\n\
113The \"quick\"\n\
114brown fox\n\
115jumps over\n\
116the 'lazy' dog.\n\
117"; assert(x == y)
118y = '\n\
119The \"quick\"\n\
120brown fox\n\
121jumps over\n\
122the \'lazy\' dog.\n\
123'; assert(x == y)
Guido van Rossumb31c7f71993-11-11 10:31:23 +0000124
125
Guido van Rossum3bead091992-01-27 17:00:37 +0000126print '1.2 Grammar'
127
128print 'single_input' # NEWLINE | simple_stmt | compound_stmt NEWLINE
129# XXX can't test in a script -- this rule is only used when interactive
130
131print 'file_input' # (NEWLINE | stmt)* ENDMARKER
132# Being tested as this very moment this very module
133
134print 'expr_input' # testlist NEWLINE
135# XXX Hard to test -- used only in calls to input()
136
137print 'eval_input' # testlist ENDMARKER
138x = eval('1, 0 or 1')
139
140print 'funcdef'
141### 'def' NAME parameters ':' suite
142### parameters: '(' [varargslist] ')'
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000143### varargslist: (fpdef ['=' test] ',')* ('*' NAME [',' ('**'|'*' '*') NAME]
144### | ('**'|'*' '*') NAME)
145### | fpdef ['=' test] (',' fpdef ['=' test])* [',']
Guido van Rossum3bead091992-01-27 17:00:37 +0000146### fpdef: NAME | '(' fplist ')'
147### fplist: fpdef (',' fpdef)* [',']
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000148### arglist: (argument ',')* (argument | *' test [',' '**' test] | '**' test)
149### argument: [test '='] test # Really [keyword '='] test
Guido van Rossum3bead091992-01-27 17:00:37 +0000150def f1(): pass
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000151f1()
152f1(*())
153f1(*(), **{})
Guido van Rossum3bead091992-01-27 17:00:37 +0000154def f2(one_argument): pass
155def f3(two, arguments): pass
156def f4(two, (compound, (argument, list))): pass
157def a1(one_arg,): pass
158def a2(two, args,): pass
159def v0(*rest): pass
160def v1(a, *rest): pass
161def v2(a, b, *rest): pass
162def v3(a, (b, c), *rest): pass
Guido van Rossumb6775db1994-08-01 11:34:53 +0000163def d01(a=1): pass
164d01()
165d01(1)
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000166d01(*(1,))
167d01(**{'a':2})
Guido van Rossumb6775db1994-08-01 11:34:53 +0000168def d11(a, b=1): pass
169d11(1)
170d11(1, 2)
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000171d11(1, **{'b':2})
Guido van Rossumb6775db1994-08-01 11:34:53 +0000172def d21(a, b, c=1): pass
173d21(1, 2)
174d21(1, 2, 3)
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000175d21(*(1, 2, 3))
176d21(1, *(2, 3))
177d21(1, 2, *(3,))
178d21(1, 2, **{'c':3})
Guido van Rossumb6775db1994-08-01 11:34:53 +0000179def d02(a=1, b=2): pass
180d02()
181d02(1)
182d02(1, 2)
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000183d02(*(1, 2))
184d02(1, *(2,))
185d02(1, **{'b':2})
186d02(**{'a': 1, 'b': 2})
Guido van Rossumb6775db1994-08-01 11:34:53 +0000187def d12(a, b=1, c=2): pass
188d12(1)
189d12(1, 2)
190d12(1, 2, 3)
191def d22(a, b, c=1, d=2): pass
192d22(1, 2)
193d22(1, 2, 3)
194d22(1, 2, 3, 4)
195def d01v(a=1, *rest): pass
196d01v()
197d01v(1)
198d01v(1, 2)
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000199d01v(*(1, 2, 3, 4))
200d01v(*(1,))
201d01v(**{'a':2})
Guido van Rossumb6775db1994-08-01 11:34:53 +0000202def d11v(a, b=1, *rest): pass
203d11v(1)
204d11v(1, 2)
205d11v(1, 2, 3)
206def d21v(a, b, c=1, *rest): pass
207d21v(1, 2)
208d21v(1, 2, 3)
209d21v(1, 2, 3, 4)
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000210d21v(*(1, 2, 3, 4))
211d21v(1, 2, **{'c': 3})
Guido van Rossumb6775db1994-08-01 11:34:53 +0000212def d02v(a=1, b=2, *rest): pass
213d02v()
214d02v(1)
215d02v(1, 2)
216d02v(1, 2, 3)
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000217d02v(1, *(2, 3, 4))
218d02v(**{'a': 1, 'b': 2})
Guido van Rossumb6775db1994-08-01 11:34:53 +0000219def d12v(a, b=1, c=2, *rest): pass
220d12v(1)
221d12v(1, 2)
222d12v(1, 2, 3)
223d12v(1, 2, 3, 4)
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000224d12v(*(1, 2, 3, 4))
225d12v(1, 2, *(3, 4, 5))
226d12v(1, *(2,), **{'c': 3})
Guido van Rossumb6775db1994-08-01 11:34:53 +0000227def d22v(a, b, c=1, d=2, *rest): pass
228d22v(1, 2)
229d22v(1, 2, 3)
230d22v(1, 2, 3, 4)
231d22v(1, 2, 3, 4, 5)
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000232d22v(*(1, 2, 3, 4))
233d22v(1, 2, *(3, 4, 5))
234d22v(1, *(2, 3), **{'d': 4})
Guido van Rossum3bead091992-01-27 17:00:37 +0000235
236### stmt: simple_stmt | compound_stmt
237# Tested below
238
239### simple_stmt: small_stmt (';' small_stmt)* [';']
240print 'simple_stmt'
241x = 1; pass; del x
242
Guido van Rossumb3b09c91993-10-22 14:24:22 +0000243### small_stmt: expr_stmt | print_stmt | pass_stmt | del_stmt | flow_stmt | import_stmt | global_stmt | access_stmt | exec_stmt
Guido van Rossum3bead091992-01-27 17:00:37 +0000244# Tested below
245
246print 'expr_stmt' # (exprlist '=')* exprlist
2471
2481, 2, 3
249x = 1
250x = 1, 2, 3
251x = y = z = 1, 2, 3
252x, y, z = 1, 2, 3
253abc = a, b, c = x, y, z = xyz = 1, 2, (3, 4)
254# NB these variables are deleted below
255
256print 'print_stmt' # 'print' (test ',')* [test]
257print 1, 2, 3
258print 1, 2, 3,
259print
260print 0 or 1, 0 or 1,
261print 0 or 1
262
Barry Warsawefc92ee2000-08-21 15:46:50 +0000263print 'extended print_stmt' # 'print' '>>' test ','
264import sys
265print >> sys.stdout, 1, 2, 3
266print >> sys.stdout, 1, 2, 3,
267print >> sys.stdout
268print >> sys.stdout, 0 or 1, 0 or 1,
269print >> sys.stdout, 0 or 1
270
271# syntax errors
272def check_syntax(statement):
273 try:
274 compile(statement, '<string>', 'exec')
275 except SyntaxError:
276 pass
277 else:
278 print 'Missing SyntaxError: "%s"' % statement
279check_syntax('print ,')
280check_syntax('print >> x,')
281
Guido van Rossum3bead091992-01-27 17:00:37 +0000282print 'del_stmt' # 'del' exprlist
283del abc
284del x, y, (z, xyz)
285
286print 'pass_stmt' # 'pass'
287pass
288
289print 'flow_stmt' # break_stmt | continue_stmt | return_stmt | raise_stmt
290# Tested below
291
292print 'break_stmt' # 'break'
293while 1: break
294
295print 'continue_stmt' # 'continue'
296i = 1
297while i: i = 0; continue
298
299print 'return_stmt' # 'return' [testlist]
300def g1(): return
301def g2(): return 1
302g1()
303x = g2()
304
305print 'raise_stmt' # 'raise' test [',' test]
306try: raise RuntimeError, 'just testing'
307except RuntimeError: pass
308try: raise KeyboardInterrupt
309except KeyboardInterrupt: pass
310
311print 'import_stmt' # 'import' NAME (',' NAME)* | 'from' NAME 'import' ('*' | NAME (',' NAME)*)
Guido van Rossum3bead091992-01-27 17:00:37 +0000312import sys
Guido van Rossum51b1c1c1995-03-04 22:30:54 +0000313import time, sys
Guido van Rossumb6775db1994-08-01 11:34:53 +0000314from time import time
Guido van Rossum3bead091992-01-27 17:00:37 +0000315from sys import *
Guido van Rossum51b1c1c1995-03-04 22:30:54 +0000316from sys import path, argv
Guido van Rossum3bead091992-01-27 17:00:37 +0000317
318print 'global_stmt' # 'global' NAME (',' NAME)*
319def f():
320 global a
321 global a, b
322 global one, two, three, four, five, six, seven, eight, nine, ten
323
Guido van Rossumb3b09c91993-10-22 14:24:22 +0000324print 'exec_stmt' # 'exec' expr ['in' expr [',' expr]]
325def f():
326 z = None
327 del z
328 exec 'z=1+1\n'
329 if z <> 2: raise TestFailed, 'exec \'z=1+1\'\\n'
330 del z
331 exec 'z=1+1'
332 if z <> 2: raise TestFailed, 'exec \'z=1+1\''
333f()
334g = {}
335exec 'z = 1' in g
Guido van Rossum1f976121995-01-10 10:34:21 +0000336if g.has_key('__builtins__'): del g['__builtins__']
Guido van Rossumb3b09c91993-10-22 14:24:22 +0000337if g <> {'z': 1}: raise TestFailed, 'exec \'z = 1\' in g'
338g = {}
339l = {}
340exec 'global a; a = 1; b = 2' in g, l
Guido van Rossum1f976121995-01-10 10:34:21 +0000341if g.has_key('__builtins__'): del g['__builtins__']
342if l.has_key('__builtins__'): del l['__builtins__']
Guido van Rossumb3b09c91993-10-22 14:24:22 +0000343if (g, l) <> ({'a':1}, {'b':2}): raise TestFailed, 'exec ... in g, l'
344
345
Guido van Rossum3bead091992-01-27 17:00:37 +0000346### compound_stmt: if_stmt | while_stmt | for_stmt | try_stmt | funcdef | classdef
347# Tested below
348
349print 'if_stmt' # 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite]
350if 1: pass
351if 1: pass
352else: pass
353if 0: pass
354elif 0: pass
355if 0: pass
356elif 0: pass
357elif 0: pass
358elif 0: pass
359else: pass
360
361print 'while_stmt' # 'while' test ':' suite ['else' ':' suite]
362while 0: pass
363while 0: pass
364else: pass
365
366print 'for_stmt' # 'for' exprlist 'in' exprlist ':' suite ['else' ':' suite]
Guido van Rossum3bead091992-01-27 17:00:37 +0000367for i in 1, 2, 3: pass
Guido van Rossum3bead091992-01-27 17:00:37 +0000368for i, j, k in (): pass
369else: pass
Guido van Rossumb6775db1994-08-01 11:34:53 +0000370class Squares:
371 def __init__(self, max):
372 self.max = max
373 self.sofar = []
374 def __len__(self): return len(self.sofar)
375 def __getitem__(self, i):
376 if not 0 <= i < self.max: raise IndexError
377 n = len(self.sofar)
378 while n <= i:
379 self.sofar.append(n*n)
380 n = n+1
381 return self.sofar[i]
382n = 0
383for x in Squares(10): n = n+x
384if n != 285: raise TestFailed, 'for over growing sequence'
Guido van Rossum3bead091992-01-27 17:00:37 +0000385
Guido van Rossumb6775db1994-08-01 11:34:53 +0000386print 'try_stmt'
387### try_stmt: 'try' ':' suite (except_clause ':' suite)+ ['else' ':' suite]
388### | 'try' ':' suite 'finally' ':' suite
Guido van Rossum3bead091992-01-27 17:00:37 +0000389### except_clause: 'except' [expr [',' expr]]
Guido van Rossum85f18201992-11-27 22:53:50 +0000390try:
391 1/0
392except ZeroDivisionError:
393 pass
Guido van Rossumb6775db1994-08-01 11:34:53 +0000394else:
395 pass
Guido van Rossum3bead091992-01-27 17:00:37 +0000396try: 1/0
397except EOFError: pass
398except TypeError, msg: pass
399except RuntimeError, msg: pass
400except: pass
Guido van Rossumb6775db1994-08-01 11:34:53 +0000401else: pass
Guido van Rossum85f18201992-11-27 22:53:50 +0000402try: 1/0
403except (EOFError, TypeError, ZeroDivisionError): pass
404try: 1/0
405except (EOFError, TypeError, ZeroDivisionError), msg: pass
Guido van Rossum3bead091992-01-27 17:00:37 +0000406try: pass
407finally: pass
Guido van Rossum3bead091992-01-27 17:00:37 +0000408
409print 'suite' # simple_stmt | NEWLINE INDENT NEWLINE* (stmt NEWLINE*)+ DEDENT
410if 1: pass
411if 1:
412 pass
413if 1:
414 #
415 #
416 #
417 pass
418 pass
419 #
420 pass
421 #
422
423print 'test'
424### and_test ('or' and_test)*
425### and_test: not_test ('and' not_test)*
426### not_test: 'not' not_test | comparison
427if not 1: pass
428if 1 and 1: pass
429if 1 or 1: pass
430if not not not 1: pass
431if not 1 and 1 and 1: pass
432if 1 and 1 or 1 and 1 and 1 or not 1 and 1: pass
433
434print 'comparison'
435### comparison: expr (comp_op expr)*
436### comp_op: '<'|'>'|'=='|'>='|'<='|'<>'|'!='|'in'|'not' 'in'|'is'|'is' 'not'
437if 1: pass
438x = (1 == 1)
439if 1 == 1: pass
440if 1 != 1: pass
441if 1 <> 1: pass
442if 1 < 1: pass
443if 1 > 1: pass
444if 1 <= 1: pass
445if 1 >= 1: pass
446if 1 is 1: pass
447if 1 is not 1: pass
448if 1 in (): pass
449if 1 not in (): pass
Guido van Rossum85f18201992-11-27 22:53:50 +0000450if 1 < 1 > 1 == 1 >= 1 <= 1 <> 1 != 1 in 1 not in 1 is 1 is not 1: pass
Guido van Rossum3bead091992-01-27 17:00:37 +0000451
452print 'binary mask ops'
453x = 1 & 1
454x = 1 ^ 1
455x = 1 | 1
456
457print 'shift ops'
458x = 1 << 1
459x = 1 >> 1
460x = 1 << 1 >> 1
461
462print 'additive ops'
463x = 1
464x = 1 + 1
465x = 1 - 1 - 1
466x = 1 - 1 + 1 - 1 + 1
467
468print 'multiplicative ops'
469x = 1 * 1
470x = 1 / 1
471x = 1 % 1
472x = 1 / 1 * 1 % 1
473
474print 'unary ops'
475x = +1
476x = -1
477x = ~1
478x = ~1 ^ 1 & 1 | 1 & 1 ^ -1
479x = -1*1/1 + 1*1 - ---1*1
480
481print 'selectors'
482### trailer: '(' [testlist] ')' | '[' subscript ']' | '.' NAME
483### subscript: expr | [expr] ':' [expr]
Guido van Rossum85f18201992-11-27 22:53:50 +0000484f1()
485f2(1)
486f2(1,)
487f3(1, 2)
488f3(1, 2,)
489f4(1, (2, (3, 4)))
490v0()
491v0(1)
492v0(1,)
493v0(1,2)
494v0(1,2,3,4,5,6,7,8,9,0)
495v1(1)
496v1(1,)
497v1(1,2)
498v1(1,2,3)
499v1(1,2,3,4,5,6,7,8,9,0)
500v2(1,2)
501v2(1,2,3)
502v2(1,2,3,4)
503v2(1,2,3,4,5,6,7,8,9,0)
504v3(1,(2,3))
505v3(1,(2,3),4)
506v3(1,(2,3),4,5,6,7,8,9,0)
Jeremy Hyltonaed0d8d2000-03-28 23:51:17 +0000507print
Guido van Rossum3bead091992-01-27 17:00:37 +0000508import sys, time
509c = sys.path[0]
510x = time.time()
511x = sys.modules['time'].time()
512a = '01234'
513c = a[0]
514c = a[-1]
515s = a[0:5]
516s = a[:5]
517s = a[0:]
518s = a[:]
519s = a[-5:]
520s = a[:-1]
521s = a[-4:-3]
522
523print 'atoms'
524### atom: '(' [testlist] ')' | '[' [testlist] ']' | '{' [dictmaker] '}' | '`' testlist '`' | NAME | NUMBER | STRING
525### dictmaker: test ':' test (',' test ':' test)* [',']
526
527x = (1)
528x = (1 or 2 or 3)
529x = (1 or 2 or 3, 2, 3)
530
531x = []
532x = [1]
533x = [1 or 2 or 3]
534x = [1 or 2 or 3, 2, 3]
535x = []
536
537x = {}
538x = {'one': 1}
539x = {'one': 1,}
540x = {'one' or 'two': 1 or 2}
541x = {'one': 1, 'two': 2}
542x = {'one': 1, 'two': 2,}
543x = {'one': 1, 'two': 2, 'three': 3, 'four': 4, 'five': 5, 'six': 6}
544
545x = `x`
546x = `1 or 2 or 3`
547x = x
548x = 'x'
549x = 123
550
551### exprlist: expr (',' expr)* [',']
552### testlist: test (',' test)* [',']
553# These have been exercised enough above
554
Guido van Rossum85f18201992-11-27 22:53:50 +0000555print 'classdef' # 'class' NAME ['(' testlist ')'] ':' suite
Guido van Rossum3bead091992-01-27 17:00:37 +0000556class B: pass
557class C1(B): pass
558class C2(B): pass
559class D(C1, C2, B): pass
560class C:
561 def meth1(self): pass
562 def meth2(self, arg): pass
563 def meth3(self, a1, a2): pass
Skip Montanaro803d6e52000-08-12 18:09:51 +0000564
565# list comprehension tests
566nums = [1, 2, 3, 4, 5]
567strs = ["Apple", "Banana", "Coconut"]
568spcs = [" Apple", " Banana ", "Coco nut "]
569
570print [s.strip() for s in spcs]
571print [3 * x for x in nums]
572print [x for x in nums if x > 2]
573print [(i, s) for i in nums for s in strs]
574print [(i, s) for i in nums for s in [f for f in strs if "n" in f]]
575try:
576 eval("[i, s for i in nums for s in strs]")
577 print "FAIL: should have raised a SyntaxError!"
578except SyntaxError:
579 print "good: got a SyntaxError as expected"
580
Skip Montanaro46dfa5f2000-08-22 02:43:07 +0000581try:
582 eval("[x if y]")
583 print "FAIL: should have raised a SyntaxError!"
584except SyntaxError:
585 print "good: got a SyntaxError as expected"
586
Skip Montanaro803d6e52000-08-12 18:09:51 +0000587suppliers = [
588 (1, "Boeing"),
589 (2, "Ford"),
590 (3, "Macdonalds")
591]
592
593parts = [
594 (10, "Airliner"),
595 (20, "Engine"),
596 (30, "Cheeseburger")
597]
598
599suppart = [
600 (1, 10), (1, 20), (2, 20), (3, 30)
601]
602
603print [
604 (sname, pname)
605 for (sno, sname) in suppliers
606 for (pno, pname) in parts
607 for (sp_sno, sp_pno) in suppart
608 if sno == sp_sno and pno == sp_pno
609]