berkerpeksag / astor

Python AST read/write
https://pypi.org/project/astor/
BSD 3-Clause "New" or "Revised" License
810 stars 102 forks source link

Deprecate old API #36

Closed berkerpeksag closed 6 years ago

berkerpeksag commented 9 years ago
leonardt commented 7 years ago

From https://github.com/berkerpeksag/astor/commit/c479d88d936cf7f18db42c3c839d0433edad2f0c

It looks like these are the API changes

get_boolop = get_binop = get_cmpop = get_unaryop =  get_op_symbol # NOQA
get_anyop = get_op_symbol
parsefile = code_to_ast.parse_file
codetoast = code_to_ast
dump = dump_tree
all_symbols = symbol_data
treewalk = tree_walk
codegen = code_gen 

Anything missing?

Deprecation strategy?

Either strategy will require an update to the docs. I'd be happy to take on this issue once the questions above are addressed.

pmaupin commented 7 years ago

I think a warning would be great.

Thanks, Pat

pmaupin commented 7 years ago

I've checked code to do the deprecation, @leonardt

If you could look at the doc issue (as well as the separate change log sphinx issue) that would be awesome.

Thanks, Pat

berkerpeksag commented 7 years ago

Thanks, @leonardt. We'll probably keep the old names until we release 1.0. So,

  1. Show warnings for deprecated names
  2. Document deprecated names with .. deprecated:: 0.6

sounds like a good plan to me.

pmaupin commented 7 years ago

Speaking of cluttering up the doc -- if we've never had documentation for these, should we bother adding them to the doc?

FWIW, I think the code's done. The test looks solid.

berkerpeksag commented 7 years ago

I've seen some weird usages of the current undocumented API so I guess adding something like "these things are deprecated in 0.6" to docs wouldn't hurt :)