Skip to content

Commit f587166

Browse files
committed
Pickle: Hide numpy module by default
1 parent 66c70d7 commit f587166

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/lpython/pickle.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,15 @@ class ASRPickleVisitor :
7272
s.append(")");
7373
}
7474
void visit_Module(const ASR::Module_t &x) {
75+
// hide intrinsic modules and numpy module by default
7576
if (!show_intrinsic_modules &&
76-
(x.m_intrinsic || startswith(x.m_name, "lfortran_intrinsic_"))) {
77+
(x.m_intrinsic || startswith(x.m_name, "numpy"))) {
7778
s.append("(");
7879
if (use_colors) {
7980
s.append(color(style::bold));
8081
s.append(color(fg::magenta));
8182
}
82-
s.append("IntrinsicModule");
83+
s.append(x.m_intrinsic ? "IntrinsicModule" : "Module");
8384
if (use_colors) {
8485
s.append(color(fg::reset));
8586
s.append(color(style::reset));
@@ -202,7 +203,9 @@ class ASRJsonVisitor :
202203
}
203204

204205
void visit_Module(const ASR::Module_t &x) {
205-
if (x.m_intrinsic && !show_intrinsic_modules) { // do not show intrinsic modules by default
206+
// hide intrinsic modules and numpy module by default
207+
if (!show_intrinsic_modules &&
208+
(x.m_intrinsic || startswith(x.m_name, "numpy"))) {
206209
s.append("{");
207210
inc_indent(); s.append("\n" + indtd);
208211
s.append("\"node\": \"Module\"");

0 commit comments

Comments
 (0)