Permalink
Browse files

syncing to head of tfs

  • Loading branch information...
1 parent 7d93913 commit 1b292db0fb96abaab722d84b30fff10a0b5b9626 @jredville jredville committed Oct 5, 2009
View
0 1
No changes.
@@ -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>
@@ -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>
@@ -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(
@@ -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
@@ -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.