def f(n):l=;exec"(n in l)>=any(n%k<1for k in range(2,n))>q;l=map(sum,zip(+l,l+));"*n
Try it online!
This is a named function f, which outputs via exit code, 0 for Pascal Primes, 1 otherwise.
How this works?
def f(n):l=; # Define a function f (arg. n) and a list l = .
exec"..."*n # Execute n times.
(n in l) # Boolean: "n is in l?" is greater than...
>=any(n%k<1for k in range(2,n)) # the boolean: "Is n composite?"?
>q; # If the boolean comparison returns a falsy
# result, then continue on without any difference.
# Otherwise, evaluate the other part of the
# inequality, thus performing "is greater than q".
# Since we have no variable "q", this terminates
# with exit code 1, throwing a "NameError".
l=map(sum,zip(+l,l+)); # Generate the next row in Pascal's triangle,
# By zipping l prepended with a 0 with l appended
# with a 0 and mapping sum over the result.
This basically checks whether n occurs in the first n - 1 rows of Pascal's triangle or if it is prime, and throws an error if any of these two conditions are met.
Saved 1 byte thanks to ovs.