Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Common issues we have to look out for #10

Open
maweki opened this issue Apr 28, 2020 · 6 comments
Open

Common issues we have to look out for #10

maweki opened this issue Apr 28, 2020 · 6 comments

Comments

@maweki
Copy link
Collaborator

maweki commented Apr 28, 2020

This is just a meta-issue listing the issues we have to look out for, that weren't autotranslated from python 2 to 3

Please help add to this list and keep it in mind when touching up code.

@kirienko
Copy link
Owner

Also:

  • some_dict.has_key(x) for dictionaries (→ k in some_dict);
  • str.decode() and other utf-related issues.

@kirienko
Copy link
Owner

A lot of changes related to Gtk, like:

  • Gtk.Window: self.app.windowself.app.get_window()
  • Gtk.UIManager: get_widget() now takes two arguments (self included), not five

@kirienko
Copy link
Owner

There's no Gtk.ComboBoxEntry any more. One need to use either ComboBoxText or just ComboBox. This applies also to .ui files.

Details: tutorial and class hierarchy.

@kirienko kirienko pinned this issue Apr 29, 2020
@cydanil
Copy link
Collaborator

cydanil commented Apr 29, 2020

Mea culpa, I commented on another issue. Perhaps it's worth porting all ui files using Glade, but are we targeting GTK3 or 4?

@kirienko
Copy link
Owner

kirienko commented May 1, 2020

If a class is used as an exception, it must be derived from Exception. (Strictly speaking, from BaseException but I see no benefits from going to that low level.)

class MyClass(Exception):
    pass

try:
    do_stuff()
except MyClass as e:
    print("That was a bad idea")

@takluyver
Copy link
Collaborator

For the integer divisions: I was porting another project some time ago and wanted to find all division operations to check if they were using integers. So I built a little tool called astsearch - you can run astsearch "? / ?" to identify all divisions.

@cydanil cydanil unpinned this issue Aug 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants