Skip to content

Commit

Permalink
syncing to head of tfs
Browse files Browse the repository at this point in the history
  • Loading branch information
jredville committed Oct 5, 2009
1 parent 7d93913 commit 1b292db
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Empty file added 1
Empty file.
Expand Up @@ -105,7 +105,6 @@
<NoWarn>1591</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>AnyCPU</PlatformTarget>
<CodeAnalysisRuleAssemblies>%ProgramFiles%\Microsoft Visual Studio 9.0\Team Tools\Static Analysis Tools\FxCop\Rules</CodeAnalysisRuleAssemblies>
<CodeAnalysisUseTypeNameInSuppression>true</CodeAnalysisUseTypeNameInSuppression>
<CodeAnalysisModuleSuppressionsFile>GlobalSuppressions.cs</CodeAnalysisModuleSuppressionsFile>
<ErrorReport>prompt</ErrorReport>
Expand Down Expand Up @@ -183,4 +182,4 @@
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" Condition=" '$(SilverlightTreeBuild)' != 'true' " />
<Import Project="..\..\silverlight.build.targets" Condition=" '$(SilverlightTreeBuild)' == 'true' " />
<Import Condition=" '$(Golden)' == 'True'" Project="..\..\External\Build\Microsoft.VersionNumber.targets" />
</Project>
</Project>
Expand Up @@ -483,8 +483,8 @@ static partial class PythonProtocol {
self.Restrictions
);
}
} else if (self.Value is IEnumerable ||
typeof(IEnumerable).IsAssignableFrom(self.GetLimitType())) {
} else if ((self.Value is IEnumerable ||
typeof(IEnumerable).IsAssignableFrom(self.GetLimitType())) && !(self.Value is PythonGenerator)) {
self = self.Restrict(self.GetLimitType());

return new DynamicMetaObject(
Expand Down
11 changes: 10 additions & 1 deletion Merlin/Main/Languages/IronPython/IronPython/Runtime/Generator.cs
Expand Up @@ -30,7 +30,7 @@
namespace IronPython.Runtime {
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix"), PythonType("generator")]
[DontMapIDisposableToContextManager, DontMapIEnumerableToContains]
public sealed class PythonGenerator : IEnumerator, IEnumerator<object>, ICodeFormattable {
public sealed class PythonGenerator : IEnumerator, IEnumerator<object>, ICodeFormattable, IEnumerable {
private readonly Func<MutableTuple, object>/*!*/ _next; // The delegate which contains the user code to perform the iteration.
private readonly PythonFunction _function; // the function which created the generator
private readonly MutableTuple _data; // the closure data we need to pass into each iteration. Item000 is the index, Item001 is the current value
Expand Down Expand Up @@ -564,5 +564,14 @@ class GeneratorFinalizer {
}
}
}

#region IEnumerable Members

IEnumerator IEnumerable.GetEnumerator() {
// only present for better C# interop
return this;
}

#endregion
}
}

0 comments on commit 1b292db

Please sign in to comment.