Re: backwards-compatibility

2011-03-01 Thread Jason Swails
> subpackage1 imports the exceptions module from package1, and I do that > like > > this: > > > > from ..exceptions import MyException > > > > You'll have to import that using the absolute import. It would be > "from package1.exceptions import MyException". > Ah; I didn't quite see how something i

Re: backwards-compatibility

2011-02-26 Thread Terry Reedy
On 2/26/2011 11:32 AM, Benjamin Kaplan wrote: On Sat, Feb 26, 2011 at 8:11 AM, Jason Swails wrote: Hello, I have a question I was having a difficult time finding with a quick google search, so I figured someone on here might know. For the sake of backwards compatibility (and supporting

Re: backwards-compatibility

2011-02-26 Thread Benjamin Kaplan
On Sat, Feb 26, 2011 at 8:11 AM, Jason Swails wrote: > Hello, > > I have a question I was having a difficult time finding with a quick google > search, so I figured someone on here might know.  For the sake of backwards > compatibility (and supporting systems whose default pyth

backwards-compatibility

2011-02-26 Thread Jason Swails
Hello, I have a question I was having a difficult time finding with a quick google search, so I figured someone on here might know. For the sake of backwards compatibility (and supporting systems whose default python is OLD), I'd like to rewrite some code to be compliant with Pythons as o

Re: Compiler, ast and forwards/backwards compatibility

2008-10-09 Thread Orestis Markou
On Wed, Oct 8, 2008 at 9:14 PM, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: >> The documentation for the ast module states that it "helps to find out >> programmatically what the current grammar looks like". I can't find >> any reference (even when reading the code) on how you should go about >> t

Re: Compiler, ast and forwards/backwards compatibility

2008-10-08 Thread Martin v. Löwis
> My confusion starts with the fact that I'm not sure if all Python 2.4 > code is going to be syntactically valid 2.6 code. That's not so much a matter of confusion, but of careful research. I *think* all code that is syntactically correct in 2.4 is also syntactically correct in 2.6 - but only be

Re: Compiler, ast and forwards/backwards compatibility

2008-10-08 Thread Martin v. Löwis
> The documentation for the ast module states that it "helps to find out > programmatically what the current grammar looks like". I can't find > any reference (even when reading the code) on how you should go about > this, other than checking the sys.version number and reading up on the > changes.

Re: Compiler, ast and forwards/backwards compatibility

2008-10-07 Thread Terry Reedy
Orestis Markou wrote: On Tue, Oct 7, 2008 at 5:39 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: Orestis Markou wrote: Hello, I'm the developer of PySmell ( http://github.com/orestis/pysmell ), a static analysis/intellisense provider for Python. I am targeting Python 2.4 code so I'm using the comp

Re: Compiler, ast and forwards/backwards compatibility

2008-10-07 Thread Orestis Markou
On Tue, Oct 7, 2008 at 5:39 PM, Terry Reedy <[EMAIL PROTECTED]> wrote: > Orestis Markou wrote: >> >> Hello, >> >> I'm the developer of PySmell ( http://github.com/orestis/pysmell ), a >> static analysis/intellisense provider for Python. I am targeting >> Python 2.4 code so I'm using the compiler pa

Re: Compiler, ast and forwards/backwards compatibility

2008-10-07 Thread Terry Reedy
Orestis Markou wrote: Hello, I'm the developer of PySmell ( http://github.com/orestis/pysmell ), a static analysis/intellisense provider for Python. I am targeting Python 2.4 code so I'm using the compiler package. I've been toying around yesterday with the ast module in Python 2.6 and it seems

Compiler, ast and forwards/backwards compatibility

2008-10-07 Thread Orestis Markou
Hello, I'm the developer of PySmell ( http://github.com/orestis/pysmell ), a static analysis/intellisense provider for Python. I am targeting Python 2.4 code so I'm using the compiler package. I've been toying around yesterday with the ast module in Python 2.6 and it seems much more cleaner. One

Re: Backwards compatibility [was Re: is parameter an iterable?]

2005-11-23 Thread Roy Smith
"Fredrik Lundh" <[EMAIL PROTECTED]> wrote: > I've said it many times, and I'll say it again: the only fundamentally > new concept that has been added since Python 1.5.2 is generators. > [...] > All the rest is just coloured frosting In my mind, the biggest thing since 1.5.2 is string methods. T

Re: Backwards compatibility [was Re: is parameter an iterable?]

2005-11-23 Thread Fredrik Lundh
Tom Anderson wrote: > How about detecting which environment you're in, then running one of two > entirely different sets of code? Rather than trying to construct modern > features in the antique environment, write code for each, using the local > idioms. The trouble with this is that you end up wi

Re: Backwards compatibility [was Re: is parameter an iterable?]

2005-11-22 Thread Tom Anderson
On Tue, 22 Nov 2005, Steven D'Aprano wrote: > Are there practical idioms for solving the metaproblem "solve problem X > using the latest features where available, otherwise fall back on older, > less powerful features"? > > For instance, perhaps I might do this: > > try: >built_in_feature >

Re: Backwards compatibility [was Re: is parameter an iterable?]

2005-11-21 Thread Fredrik Lundh
;t be available in 2.0 any more than > iter would. "Consuming" didn't really come into consideration for the > backwards compatibility part because only objects indexable with > integers, 0 and up (and raising IndexError at some point) were usable in > for statements in o

Re: Backwards compatibility [was Re: is parameter an iterable?]

2005-11-21 Thread Steven D'Aprano
Alex Martelli wrote: > "Consuming" didn't really come into consideration for the > backwards compatibility part because only objects indexable with > integers, 0 and up (and raising IndexError at some point) were usable in > for statements in old Pythons, there was

Re: Backwards compatibility [was Re: is parameter an iterable?]

2005-11-21 Thread Alex Martelli
;Consuming" didn't really come into consideration for the backwards compatibility part because only objects indexable with integers, 0 and up (and raising IndexError at some point) were usable in for statements in old Pythons, there was no "consuming". The tests here are not 100% reli

Backwards compatibility [was Re: is parameter an iterable?]

2005-11-21 Thread Steven D'Aprano
ns of Python? > > > python 2.1 doesn't support iterators, so that question doesn't > make much sense. The _question_ doesn't make much sense? I could understand you saying that backwards-compatibility is "not important [to me]" but to say that the very que