Skip to content

Commit b28d7b2

Browse files
committed
renamed module __builtin__ to builtins
1 parent aa24f99 commit b28d7b2

File tree

6 files changed

+8
-8
lines changed

6 files changed

+8
-8
lines changed

Src/IronPython.Modules/_io.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public static void PerformModuleReload(PythonContext/*!*/ context, PythonDiction
6060
typeof(BlockingIOError),
6161
dict,
6262
"BlockingIOError",
63-
"__builtin__",
63+
"builtins",
6464
msg => new _BlockingIOErrorException(msg)
6565
);
6666
context.EnsureModuleException(

Src/IronPython/Modules/Builtin.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@
4242
using Complex = Microsoft.Scripting.Math.Complex64;
4343
#endif
4444

45-
[assembly: PythonModule("__builtin__", typeof(IronPython.Modules.Builtin))]
45+
[assembly: PythonModule("builtins", typeof(IronPython.Modules.Builtin))]
4646
namespace IronPython.Modules {
4747
[Documentation("")] // Documentation suppresses XML Doc on startup.
4848
public static partial class Builtin {
4949
public const string __doc__ = "Provides access to commonly used built-in functions, exception objects, etc...";
5050
public const object __package__ = null;
51-
public const string __name__ = "__builtin__";
51+
public const string __name__ = "builtins";
5252

5353
public static object True {
5454
get {
@@ -2472,7 +2472,7 @@ private static CompileFlags GetCompilerFlags(int flags) {
24722472

24732473
if (!globals.ContainsKey("__builtins__")) {
24742474
if (setBuiltinsToModule) {
2475-
globals["__builtins__"] = python.SystemStateModules["__builtin__"];
2475+
globals["__builtins__"] = python.SystemStateModules["builtins"];
24762476
} else {
24772477
globals["__builtins__"] = python.BuiltinModuleDict;
24782478
}

Src/IronPython/Runtime/Operations/PythonTypeOps.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ internal static string GetModuleName(CodeContext/*!*/ context, Type type) {
6767
return (string)modField.GetRawConstantValue();
6868
}
6969

70-
return "__builtin__";
70+
return "builtins";
7171
}
7272

7373
internal static object CallParams(CodeContext/*!*/ context, PythonType cls, params object[] args\u03c4) {

Src/IronPython/Runtime/PythonContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1831,7 +1831,7 @@ private void InitializeBuiltins() {
18311831

18321832
_builtins = new PythonModule(dict);
18331833

1834-
_modulesDict["__builtin__"] = _builtins;
1834+
_modulesDict["builtins"] = _builtins;
18351835
}
18361836

18371837
private Dictionary<string, Type> CreateBuiltinTable() {

Src/IronPython/Runtime/Types/BuiltinFunction.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,7 @@ public string Get__module__(CodeContext/*!*/ context) {
649649
PythonType declaringType = DynamicHelpers.GetPythonTypeFromType(DeclaringType);
650650

651651
string res = PythonTypeOps.GetModuleName(context, declaringType.UnderlyingSystemType);
652-
if (res != "__builtin__" || DeclaringType == typeof(IronPython.Modules.Builtin)) {
652+
if (res != "builtins" || DeclaringType == typeof(IronPython.Modules.Builtin)) {
653653
return res;
654654
}
655655
}

Src/IronPython/Runtime/Types/PythonType.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ public static void Set__name__(PythonType type, string name) {
695695
if (IsSystemType) {
696696
if (PythonTypeOps.IsRuntimeAssembly(UnderlyingSystemType.GetTypeInfo().Assembly) || IsPythonType) {
697697
object module = Get__module__(context, this);
698-
if (!module.Equals("__builtin__")) {
698+
if (!module.Equals("builtins")) {
699699
return string.Format("<type '{0}.{1}'>", module, Name);
700700
}
701701
}

0 commit comments

Comments
 (0)