-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1304 from STEllAR-GROUP/fixing_1301
Fixing handling of tuples as return values
- Loading branch information
Showing
4 changed files
with
56 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Copyright (c) 2021 Steven R. Brandt | ||
# | ||
# Distributed under the Boost Software License, Version 1.0. (See accompanying | ||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) | ||
|
||
# #1301: Error processing if statement | ||
|
||
from phylanx import Phylanx | ||
import numpy as np | ||
|
||
|
||
def __type(x): # silence Flake | ||
pass | ||
|
||
|
||
@Phylanx | ||
def lshape(x): | ||
if (__type(x) == __type(list()) and len(x) == 0): | ||
return (0,) | ||
else: | ||
return np.shape(x) | ||
|
||
|
||
result = lshape(np.linspace(0, 1, 100)) | ||
assert result == [100], result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters