Skip to content

Commit

Permalink
Merge pull request IronLanguages#43 from paweljasinski/i40
Browse files Browse the repository at this point in the history
renamed module __builtin__ to builtins
  • Loading branch information
paweljasinski committed Mar 27, 2014
2 parents aa24f99 + b28d7b2 commit c8ad6f7
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Src/IronPython.Modules/_io.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public static void PerformModuleReload(PythonContext/*!*/ context, PythonDiction
typeof(BlockingIOError),
dict,
"BlockingIOError",
"__builtin__",
"builtins",
msg => new _BlockingIOErrorException(msg)
);
context.EnsureModuleException(
Expand Down
6 changes: 3 additions & 3 deletions Src/IronPython/Modules/Builtin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@
using Complex = Microsoft.Scripting.Math.Complex64;
#endif

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

public static object True {
get {
Expand Down Expand Up @@ -2472,7 +2472,7 @@ private static CompileFlags GetCompilerFlags(int flags) {

if (!globals.ContainsKey("__builtins__")) {
if (setBuiltinsToModule) {
globals["__builtins__"] = python.SystemStateModules["__builtin__"];
globals["__builtins__"] = python.SystemStateModules["builtins"];
} else {
globals["__builtins__"] = python.BuiltinModuleDict;
}
Expand Down
2 changes: 1 addition & 1 deletion Src/IronPython/Runtime/Operations/PythonTypeOps.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ internal static string GetModuleName(CodeContext/*!*/ context, Type type) {
return (string)modField.GetRawConstantValue();
}

return "__builtin__";
return "builtins";
}

internal static object CallParams(CodeContext/*!*/ context, PythonType cls, params object[] args\u03c4) {
Expand Down
2 changes: 1 addition & 1 deletion Src/IronPython/Runtime/PythonContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1831,7 +1831,7 @@ private void InitializeBuiltins() {

_builtins = new PythonModule(dict);

_modulesDict["__builtin__"] = _builtins;
_modulesDict["builtins"] = _builtins;
}

private Dictionary<string, Type> CreateBuiltinTable() {
Expand Down
2 changes: 1 addition & 1 deletion Src/IronPython/Runtime/Types/BuiltinFunction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,7 @@ public string Get__module__(CodeContext/*!*/ context) {
PythonType declaringType = DynamicHelpers.GetPythonTypeFromType(DeclaringType);

string res = PythonTypeOps.GetModuleName(context, declaringType.UnderlyingSystemType);
if (res != "__builtin__" || DeclaringType == typeof(IronPython.Modules.Builtin)) {
if (res != "builtins" || DeclaringType == typeof(IronPython.Modules.Builtin)) {
return res;
}
}
Expand Down
2 changes: 1 addition & 1 deletion Src/IronPython/Runtime/Types/PythonType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,7 @@ public static void Set__name__(PythonType type, string name) {
if (IsSystemType) {
if (PythonTypeOps.IsRuntimeAssembly(UnderlyingSystemType.GetTypeInfo().Assembly) || IsPythonType) {
object module = Get__module__(context, this);
if (!module.Equals("__builtin__")) {
if (!module.Equals("builtins")) {
return string.Format("<type '{0}.{1}'>", module, Name);
}
}
Expand Down

0 comments on commit c8ad6f7

Please sign in to comment.