[core/compatibility] Implement next().
[core/compatibility] Implement next().

To get the next element of an iterator, python3 requires you to write
next(iter), python2.5 requires iter.next(), and all versions in between
allow both.

This commit implements a next() function, to allow uniform incrementation
of iterators across all supported python versions.

pbrady/sympy,farhaanbukhsh/sympy,skirpichev/omg,moble/sympy,asm666/sympy,kaushik94/sympy,hargup/sympy,bukzor/sympy,kevalds51/sympy,Vishluck/sympy,Gadal/sympy,Titan-C/sympy,postvakje/sympy,flacjacket/sympy,saurabhjn76/sympy,aktech/sympy,yashsharan/sympy,AkademieOlympia/sympy,emon10005/sympy,VaibhavAgarwalVA/sympy,debugger22/sympy,maniteja123/sympy,vipulroxx/sympy,grevutiu-gabriel/sympy,ChristinaZografou/sympy,shipci/sympy,moble/sympy,aktech/sympy,jbbskinny/sympy,iamutkarshtiwari/sympy,abloomston/sympy,Sumith1896/sympy,madan96/sympy,yukoba/sympy,wyom/sympy,yashsharan/sympy,grevutiu-gabriel/sympy,Vishluck/sympy,sunny94/temp,diofant/diofant,skidzo/sympy,souravsingh/sympy,cswiercz/sympy,meghana1995/sympy,mafiya69/sympy,toolforger/sympy,MridulS/sympy,sampadsaha5/sympy,jerli/sympy,maniteja123/sympy,madan96/sympy,srjoglekar246/sympy,atsao72/sympy,farhaanbukhsh/sympy,MechCoder/sympy,rahuldan/sympy,mafiya69/sympy,souravsingh/sympy,Davidjohnwilson/sympy,lidavidm/sympy,ga7g08/sympy,Sumith1896/sympy,debugger22/sympy,ChristinaZografou/sympy,amitjamadagni/sympy,hrashk/sympy,lindsayad/sympy,ga7g08/sympy,shipci/sympy,skidzo/sympy,yukoba/sympy,kmacinnis/sympy,garvitr/sympy,beni55/sympy,kaichogami/sympy,Curious72/sympy,cccfran/sympy,Davidjohnwilson/sympy,sampadsaha5/sympy,wanglongqi/sympy,Shaswat27/sympy,oliverlee/sympy,mcdaniel67/sympy,mafiya69/sympy,abhiii5459/sympy,lidavidm/sympy,jaimahajan1997/sympy,aktech/sympy,kaushik94/sympy,jaimahajan1997/sympy,kumarkrishna/sympy,cswiercz/sympy,meghana1995/sympy,amitjamadagni/sympy,Arafatk/sympy,emon10005/sympy,atsao72/sympy,kumarkrishna/sympy,vipulroxx/sympy,maniteja123/sympy,bukzor/sympy,pbrady/sympy,vipulroxx/sympy,sahmed95/sympy,liangjiaxing/sympy,Mitchkoens/sympy,pbrady/sympy,lindsayad/sympy,sunny94/temp,Gadal/sympy,sahmed95/sympy,jerli/sympy,Sumith1896/sympy,Designist/sympy,garvitr/sympy,MridulS/sympy,atsao72/sympy,atreyv/sympy,wyom/sympy,Arafatk/sympy,meghana1995/sympy,beni55/sympy,AunShiLord/sympy,saurabhjn76/sympy,kmacinnis/sympy,liangjiaxing/sympy,drufat/sympy,sahilshekhawat/sympy,saurabhjn76/sympy,oliverlee/sympy,Shaswat27/sympy,jbbskinny/sympy,yukoba/sympy,debugger22/sympy,kevalds51/sympy,yashsharan/sympy,ahhda/sympy,sahilshekhawat/sympy,lindsayad/sympy,dqnykamp/sympy,postvakje/sympy,abhiii5459/sympy,hrashk/sympy,Mitchkoens/sympy,asm666/sympy,shikil/sympy,drufat/sympy,AkademieOlympia/sympy,MechCoder/sympy,toolforger/sympy,beni55/sympy,lidavidm/sympy,moble/sympy,rahuldan/sympy,hargup/sympy,Titan-C/sympy,abloomston/sympy,iamutkarshtiwari/sympy,kaichogami/sympy,hrashk/sympy,Designist/sympy,postvakje/sympy,dqnykamp/sympy,Mitchkoens/sympy,kaichogami/sympy,jamesblunt/sympy,mcdaniel67/sympy,jamesblunt/sympy,VaibhavAgarwalVA/sympy,cccfran/sympy,shikil/sympy,Arafatk/sympy,shipci/sympy,hargup/sympy,sampadsaha5/sympy,wyom/sympy,chaffra/sympy,farhaanbukhsh/sympy,VaibhavAgarwalVA/sympy,shikil/sympy,toolforger/sympy,cccfran/sympy,Curious72/sympy,ahhda/sympy,emon10005/sympy,jerli/sympy,rahuldan/sympy,abhiii5459/sympy,ga7g08/sympy,Titan-C/sympy,wanglongqi/sympy,kaushik94/sympy,asm666/sympy,jbbskinny/sympy,kmacinnis/sympy,kevalds51/sympy,MechCoder/sympy,Vishluck/sympy,Shaswat27/sympy,ChristinaZografou/sympy,sahmed95/sympy,pandeyadarsh/sympy,oliverlee/sympy,Designist/sympy,AkademieOlympia/sympy,jamesblunt/sympy,sunny94/temp,souravsingh/sympy,atreyv/sympy,drufat/sympy,ahhda/sympy,AunShiLord/sympy,Gadal/sympy,garvitr/sympy,pandeyadarsh/sympy,pandeyadarsh/sympy,sahilshekhawat/sympy,kumarkrishna/sympy,dqnykamp/sympy,grevutiu-gabriel/sympy,MridulS/sympy,chaffra/sympy,bukzor/sympy,abloomston/sympy,atreyv/sympy,Davidjohnwilson/sympy,wanglongqi/sympy,madan96/sympy,jaimahajan1997/sympy,mcdaniel67/sympy,skidzo/sympy,iamutkarshtiwari/sympy,Curious72/sympy,chaffra/sympy,liangjiaxing/sympy,AunShiLord/sympy,cswiercz/sympy